/* =========================================================
   LegalMatch — expert.css
   Completely Independent Expert Styling
   ========================================================= */

:root {
    --expert-primary: #3b82f6;
    --expert-dark:    #1e40af;
    --expert-accent:  #fbbf24; /* Gold */
    --expert-bg:      #f8fafc;
    --expert-nav:     #111827;
    --text-main:      #1e293b;
    --text-muted:     #64748b;
    --border:         #e2e8f0;
    --radius:         12px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Pretendard', sans-serif;
    background: var(--expert-bg);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}
.expert-body--auth {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1c2c 0%, #4a192c 100%);
}
.expert-body--auth-public {
    background: var(--expert-bg);
}
.expert-layout--column {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.expert-layout--column .expert-main { flex: 1; }
.expert-main--auth { padding: 48px 0 64px; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Grid/Layout Helpers ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.text-center { text-align: center; }

/* ── Expert Navbar ── */
.portal-navbar {
    background: var(--expert-nav);
    color: #fff;
    padding: 0 40px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-brand { font-size: 1.2rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.navbar-brand strong { color: var(--expert-accent); }
.navbar-nav { display: flex; gap: 32px; height: 100%; list-style: none; }
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.nav-link { 
    color: #94a3b8; font-weight: 500; font-size: 0.95rem; cursor: pointer; height: 100%; 
    display: flex; align-items: center; padding: 0 4px; transition: 0.2s;
}
.nav-link:hover, .nav-item:hover .nav-link { color: #fff; }
.nav-link.active { color: var(--expert-accent); border-bottom: 3px solid var(--expert-accent); }

/* ── Dropdown ── */
.dropdown-content {
    position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
    background: #fff; min-width: 180px; box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 0 0 12px 12px; opacity: 0; visibility: hidden; transition: 0.3s; overflow: hidden;
}
.nav-item:hover .dropdown-content { opacity: 1; visibility: visible; }
.dropdown-item { 
    display: block; padding: 12px 20px; color: #374151; text-decoration: none; font-size: 0.9rem; border-bottom: 1px solid #f3f4f6;
}
.dropdown-item:hover { background: #f9fafb; color: var(--expert-primary); }

/* ── Main ── */
.expert-main { padding: 40px 0; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.glass { background: #fff; }

/* ── Components ── */
.btn { 
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; 
    padding: 10px 24px; border-radius: 10px; font-weight: 600; cursor: pointer; transition: 0.2s; border: 1px solid transparent;
}
.btn-primary { background: var(--expert-primary); color: #fff; }
.btn-primary:hover { background: var(--expert-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.badge-gold { background: var(--expert-accent); color: #000; }

/* ── Form ── */
.form-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }
.form-control { 
    padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); font-size: 0.95rem; 
    transition: 0.2s; outline: none;
}
.form-control:focus { border-color: var(--expert-primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }

.producer-type-radios { display: flex; flex-direction: column; gap: 10px; }
.producer-type-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}
.producer-type-radio:hover { background: #f8fafc; }
.producer-type-radio:has(input:checked) {
    border-color: var(--expert-primary);
    background: #eff6ff;
}
.producer-type-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--expert-primary);
    flex-shrink: 0;
}

/* ── Dashboard Stats ── */
.metric-card { display: flex; align-items: center; gap: 20px; padding: 24px; }
.metric-icon { font-size: 1.5rem; background: #eff6ff; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 16px; }
.metric-data .label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.metric-data .value { font-size: 1.8rem; font-weight: 800; }

/* ── Tables ── */
.expert-table { width: 100%; border-collapse: collapse; }
.expert-table th { background: #f8fafc; text-align: left; padding: 14px 20px; font-size: 0.75rem; color: #64748b; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.expert-table td { padding: 18px 20px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.expert-table tr:hover td { background: #fcfcfd; }

/* ── Portal Footer ── */
.portal-footer { background: #fff; border-top: 1px solid var(--border); padding: 40px 0; margin-top: auto; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; }
.footer-info { font-size: 0.85rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; align-items: center; }

/* ── Guest navbar (로그인·가입) ── */
.portal-navbar--guest { justify-content: space-between; }
.header-right--guest {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-guest-link {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 8px;
}
.nav-guest-link:hover { color: #fff; }
.portal-navbar .btn-outline {
    border-color: #475569;
    color: #e2e8f0;
}
.portal-navbar .btn-outline:hover { background: rgba(255,255,255,0.08); color: #fff; }
.portal-navbar .btn-outline.is-active {
    border-color: var(--expert-accent);
    color: var(--expert-accent);
}
.portal-navbar .btn-primary.is-active {
    background: var(--expert-dark);
}
.btn-logout { color: #ef4444 !important; border-color: #ef4444 !important; }
.btn-logout:hover { background: rgba(239, 68, 68, 0.1) !important; }

/* ── Auth pages (로그인·가입) ── */
.expert-auth-page { max-width: 480px; margin: 0 auto; }
.expert-auth-page--wide { max-width: 560px; }
.expert-auth-page--profile {
    max-width: 1120px;
    width: 100%;
}
.expert-auth-page--profile .expert-auth-card {
    padding: 28px 32px;
}
.expert-auth-page--profile .consultant-profile-page {
    max-width: none;
    width: 100%;
}
.expert-auth-card--wide { max-width: none; }
.expert-auth-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}
.text-muted { color: var(--text-muted); font-size: 0.95rem; }
.required { color: #ef4444; }
.form-error { color: #dc2626; font-size: 0.8rem; margin-top: 4px; }
.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 10px;
}
.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 10px;
}
.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.forgot-link { color: var(--text-muted); font-size: 0.9rem; }
.forgot-link:hover { color: var(--expert-primary); }
.auth-portal-switch {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.75;
}
.auth-footer a { color: var(--expert-primary); font-weight: 600; }
.auth-footer p { margin: 0; }
.auth-footer p + p { margin-top: 8px; }
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 28px;
}
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 4px;
}
.checkbox-container input:checked ~ .checkmark { background: var(--expert-primary); border-color: var(--expert-primary); }
.checkbox-container input:checked ~ .checkmark:after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
select.form-control { appearance: auto; cursor: pointer; }
.form-label small { font-weight: 400; color: var(--text-muted); }

/* ── Page header ── */
.page-header { margin-bottom: 8px; }
.page-title { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px; }
.fw-600 { font-weight: 600; }
.font-xs { font-size: 0.75rem; }
.font-mono { font-family: ui-monospace, monospace; }
.text-primary-light { color: var(--expert-primary); }
.flex-wrap { flex-wrap: wrap; }
.py-48 { padding-top: 48px; padding-bottom: 48px; }

/* ── Bookings table ── */
.filter-tabs { gap: 8px; }
.tab-btn {
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    font-weight: 500;
    background: #fff;
    white-space: nowrap;
}
.tab-btn:hover { background: #f8fafc; color: var(--text-main); }
.tab-btn.active {
    background: var(--expert-primary);
    color: #fff;
    border-color: var(--expert-primary);
}
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 720px;
}
.data-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 14px 16px;
    border-bottom: 2px solid var(--border);
    text-align: center;
    white-space: nowrap;
}
.data-table thead th:nth-child(2) { text-align: left; }
.data-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #eef2f6;
    color: #334155;
    vertical-align: middle;
    text-align: center;
}
.data-table tbody td:nth-child(2) { text-align: left; }
.data-table tbody tr:hover td { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-producer_approved { background: #dbeafe; color: #1e40af; }
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

.btn-accent {
    background: #fff;
    border: 1px solid #fca5a5;
    color: #dc2626;
}
.btn-accent:hover { background: #fef2f2; }

/* ── Consultation modal ── */
.summary-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.summary-modal--hidden { display: none !important; }
.summary-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}
.summary-modal__panel {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: min(85vh, 720px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 1;
    margin: 0;
}
.summary-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.summary-modal__header h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.summary-modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.summary-modal__body {
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
}
.summary-modal__footer {
    margin-top: 20px;
    text-align: right;
    flex-shrink: 0;
}
.consult-section + .consult-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.consult-section__title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}
.consult-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-main);
}
.consult-meta-list li { margin-bottom: 4px; }
.consult-text {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    line-height: 1.7;
    color: var(--text-main);
    white-space: pre-wrap;
}
.chat-transcript { display: flex; flex-direction: column; gap: 12px; }
.chat-bubble {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
}
.chat-bubble--user { background: #eff6ff; border-color: #bfdbfe; }
.chat-bubble--ai { background: #f8fafc; }
.chat-bubble__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}
.chat-bubble p { margin: 0; line-height: 1.65; color: var(--text-main); white-space: pre-wrap; }
.consult-text--inline { max-width: 360px; font-size: 0.88rem; }
.result-view { min-height: 120px; }
.justify-end { justify-content: flex-end; }
textarea.form-control { resize: vertical; min-height: 160px; }

@media (max-width: 768px) {
    .portal-navbar { padding: 0 16px; }
    .navbar-nav { display: none; }
    .data-table { font-size: 0.85rem; }
    .data-table thead th,
    .data-table tbody td { padding: 10px 8px; }
}

.payment-method-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.payment-method-tab {
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.payment-method-tab:hover:not(:disabled) {
    border-color: #94a3b8;
    color: var(--text-main);
}

.payment-method-tab.is-active {
    border-color: var(--expert-primary);
    background: rgba(59, 130, 246, 0.06);
    color: var(--expert-primary);
}

.payment-method-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.payment-card-panel {
    text-align: center;
    padding: 24px 16px;
}

.payment-card-panel p {
    color: var(--text-muted);
    margin-bottom: 20px;
}
