/* ============================================
   ANM Booking App — Shared Structure
   book.css
   Layout, positioning, display, spacing only.
   No colors, border-radius, shadows, or fonts.
   ============================================ */

/* ============================================
   BASE
   ============================================ */

body { margin: 0; padding: 0; width: 100%; font-family: sans-serif; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
ul { display: block; margin: 0; padding: 0; list-style-type: none; text-align: left; }
p { text-align: center; font-family: arial; font-size: 20px; margin: 0 0 40px 0; }
input { display: none; }
h1 { text-align: center; }
h4 { text-align: center; }
video { display: block; margin: 15px auto 0; }

/* ============================================
   SESSION WARNING
   ============================================ */

#session-warning {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
}

/* ============================================
   CORPUS
   ============================================ */

.corpus {
    margin: 0 auto;
    padding: 0 20px;
    max-width: 1100px;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   LOGIN
   ============================================ */

.login-form {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    margin: 0 auto;
    gap: 10px;
}

.login-form label {
    font-size: var(--font-size-sm);
    font-weight: bold;
    text-align: left;
    margin-bottom: 0;
}

.login-form input,
.login-form button {
    display: block !important;
    padding: 10px 16px;
    border: 2px solid transparent;
    font-size: var(--font-size-base);
    width: 100%;
    box-sizing: border-box;
    outline: none;
}

.login-form button {
    margin-top: 10px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.login-error {
    max-width: 400px;
    margin: 0 auto 16px;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
    text-align: left;
    border-left: 3px solid transparent;
}

/* ============================================
   MODAL
   ============================================ */

.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    padding: 4px 8px;
    font-size: var(--font-size-sm);
    font-weight: bold;
    white-space: nowrap;
    transform: translateY(-50%);
    opacity: 0.9;
}

.modal-btn-inline { display: inline !important; width: auto; font-weight: normal; }

.cancel-scope-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.custom-time-toggle {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--font-size-sm); font-weight: bold;
    cursor: pointer; margin-top: 4px;
}

.recurrence-toggle {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--font-size-sm); font-weight: bold;
    cursor: pointer; margin-top: 8px;
}

#recurs-options { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 0 0; }

.series-scope { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.series-scope-label { font-size: var(--font-size-sm); font-weight: bold; margin-bottom: 2px; }
.series-scope label { display: flex; align-items: center; gap: 6px; font-weight: normal; cursor: pointer; }

.modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000;
    justify-content: center;
    align-items: flex-end;
}

.modal-overlay.modal--open { display: flex; }

.modal {
    position: relative;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 24px 20px 40px;
    box-sizing: border-box;
}

.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 30px; height: 30px;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
}

.modal-title { margin: 0 0 4px; font-size: var(--font-size-lg); padding-right: 40px; }
.modal-subtitle { margin: 0 0 20px; font-size: var(--font-size-sm); }

.modal-form { display: flex; flex-direction: column; gap: 8px; }
.modal-form label { font-size: var(--font-size-sm); font-weight: bold; margin-top: 4px; }

.modal-form input,
.modal-form select,
.modal-form textarea {
    display: block !important;
    width: 100%;
    padding: 10px 14px;
    font-size: var(--font-size-base);
    border: 2px solid transparent;
    box-sizing: border-box;
    outline: none;
}

.modal-form textarea { resize: vertical; min-height: 80px; font-family: var(--font-main); }

.modal-btn {
    padding: 10px 20px;
    font-size: var(--font-size-base);
    font-weight: bold;
    border: none; cursor: pointer; margin-top: 8px;
}

.modal-error {
    font-size: var(--font-size-sm);
    padding: 8px 12px;
    border-left: 3px solid transparent;
}

@media (min-width: 768px) {
    .modal-overlay { align-items: center; }
    .modal { width: 480px; max-height: 85vh; border-radius: 20px; }
}

/* ============================================
   DETAIL PANEL
   ============================================ */

.detail-panel {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 85vh;
    display: flex; flex-direction: column;
}

.detail-panel--open { transform: translateY(0); }

.detail-panel-inner { position: relative; overflow-y: auto; flex: 1; padding: 24px 20px 32px; }

.detail-close {
    position: absolute; top: 16px; right: 16px;
    width: 30px; height: 30px;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
}

.detail-header { margin-bottom: 20px; padding-right: 40px; }
.detail-status { display: inline-block; font-size: var(--font-size-sm); font-weight: bold; padding: 2px 10px; margin-bottom: 8px; }
.detail-name { margin: 0 0 4px; font-size: var(--font-size-lg); }
.detail-time { margin: 0; font-size: var(--font-size-sm); }
.detail-body { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.detail-row { display: flex; align-items: flex-start; gap: 12px; }
.detail-row--full { flex-direction: column; gap: 4px; }
.detail-label { font-size: var(--font-size-sm); font-weight: bold; min-width: 60px; flex-shrink: 0; }
.detail-value { font-size: var(--font-size-sm); flex: 1; }
.detail-notes { margin: 0; font-size: var(--font-size-sm); line-height: 1.5; text-align: left; white-space: pre-wrap; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-btn { padding: 8px 16px; font-size: var(--font-size-sm); font-weight: bold; border: none; cursor: pointer; flex: 1; min-width: 80px; }

@media (min-width: 768px) {
    .detail-panel { top: 0; bottom: 0; left: auto; right: 0; width: 360px; max-height: 100vh; transform: translateX(100%); }
    .detail-panel--open { transform: translateX(0); }
}

/* ============================================
   CLIENT SEARCH
   ============================================ */

.client-search-results { overflow: hidden; margin-top: -4px; }
.client-search-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; cursor: pointer; gap: 12px; }
.client-search-name { font-size: var(--font-size-sm); font-weight: bold; }
.client-search-phone { font-size: var(--font-size-sm); }
.client-search-none { padding: 8px 12px; font-size: var(--font-size-sm); font-style: italic; }

/* ============================================
   CALENDAR — LAYOUT
   ============================================ */

.cal-wrap { display: flex; flex-direction: column; width: 100%; overflow: hidden; }

.cal-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; flex-shrink: 0; flex-wrap: wrap; gap: 8px; }
.cal-toolbar-left { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cal-toolbar-right { display: flex; align-items: center; gap: 8px; }
.cal-view-toggle { display: flex; gap: 2px; }

.cal-btn { padding: 4px 12px; line-height: 22px; cursor: pointer; border: none; font-size: var(--font-size-sm); white-space: nowrap; }
.cal-toolbar-title { padding: 4px 10px; cursor: pointer; font-size: var(--font-size-base); font-weight: bold; white-space: nowrap; }
.cal-toolbar-title-caret { font-size: 0.7rem; margin-left: 4px; }
.cal-subdivision-select { padding: 4px 8px; font-size: var(--font-size-sm); border: none; cursor: pointer; }

.cal-mini-container { padding: 8px 12px; flex-shrink: 0; }
.cal-mini-month { max-width: 280px; }
.cal-mini-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.cal-mini-title { font-size: var(--font-size-sm); font-weight: bold; }
.cal-mini-prev,
.cal-mini-next { background: none; border: none; cursor: pointer; font-size: 1.4rem; line-height: 1; padding: 0 6px; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-mini-day-label { text-align: center; font-size: 0.7rem; padding: 2px 0; font-weight: bold; }
.cal-mini-cell { text-align: center; font-size: 0.75rem; padding: 3px 0; cursor: pointer; border-radius: 50%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.cal-mini-cell--empty { cursor: default; }

.cal-week-view,
.cal-day-view { display: flex; flex-direction: column; width: 100%; overflow-x: auto; }

.cal-header-row { display: flex; flex-shrink: 0; position: sticky; top: 0; z-index: 4; }
.cal-time-gutter { width: 40px; flex-shrink: 0; position: relative; }
.cal-day-header { flex: 1; text-align: center; padding: 6px 2px; font-size: var(--font-size-sm); font-weight: bold; line-height: 1.3; }
.cal-day-header--single { font-size: var(--font-size-lg); padding: 10px; }

.cal-body { display: flex; flex: 1; touch-action: pan-y; -webkit-touch-callout: none; -webkit-user-select: none; }
.cal-body.dragging { touch-action: none; }

.cal-columns { display: flex; flex: 1; position: relative; min-width: 0; }
.cal-columns--single .cal-day-col { flex: 1; }
.cal-day-col { flex: 1; position: relative; min-width: 44px; border-left: 1px solid transparent; user-select: none; -webkit-user-select: none; }

.cal-time-label { position: absolute; right: 4px; font-size: 0.65rem; line-height: 1; transform: translateY(-50%); white-space: nowrap; }
.cal-grid-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid transparent; pointer-events: none; }

.cal-window { position: absolute; left: 1px; right: 1px; overflow: hidden; cursor: pointer; box-sizing: border-box; border-left: 3px solid transparent; }
.cal-window-label { display: block; font-size: 0.6rem; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cal-booking { position: absolute; left: 2px; right: 2px; overflow: hidden; cursor: pointer; box-sizing: border-box; display: flex; flex-direction: column; z-index: 2; }
.cal-booking-session { display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; padding: 2px 4px; flex-shrink: 0; }
.cal-booking-name { display: block; font-size: 0.65rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.cal-booking-offering { display: block; font-size: 0.55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; opacity: 0.85; }
.cal-booking-time { display: block; font-size: 0.6rem; white-space: nowrap; overflow: hidden; line-height: 1.3; }
.cal-booking-buffer { display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.cal-booking-buffer-label { font-size: 0.55rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }

.cal--mobile .cal-day-header { font-size: 0.6rem; padding: 4px 1px; line-height: 1.3; }
.cal--mobile .cal-day-col    { min-width: 36px; }
.cal--mobile .cal-time-gutter { width: 28px; }
.cal--mobile .cal-time-label { font-size: 0.55rem; }
.cal--mobile .cal-toolbar    { flex-wrap: nowrap; padding: 6px 8px; gap: 4px; }
.cal--mobile .cal-toolbar-left { flex-wrap: nowrap; gap: 2px; flex: 1; justify-content: space-between; }
.cal--mobile .cal-toolbar-right { flex-shrink: 0; gap: 4px; }
.cal--mobile .cal-btn        { padding: 4px 6px; font-size: 0.7rem; line-height: 26px; }
.cal--mobile .cal-btn--prev,
.cal--mobile .cal-btn--next  { padding: 4px 10px; }
.cal--mobile .cal-toolbar-title { font-size: 0.85rem; padding: 4px 6px; flex: 1; text-align: center; line-height: 26px; }
.cal--mobile .cal-subdivision-select { font-size: 0.7rem; padding: 2px 4px; }
.cal--mobile .cal-view-toggle { gap: 1px; }
.cal--mobile .cal-booking-name,
.cal--mobile .cal-booking-time { font-size: 0.55rem; }
