/* ============================================================
   TOURIST DASHBOARD — styles/dashboard.css
   ------------------------------------------------------------
   Moved out of dashboard.html's inline <style> block, verbatim
   (separation standard: docs/frontend-separation.md). Linked after
   styles/styles.css so page rules still win.
   ============================================================ */

/* ===== DASHBOARD LAYOUT (uses site design system variables) ===== */
.dashboard-shell {
    display: flex;
    min-height: calc(100vh - 72px);
}
.dashboard-sidebar {
    width: 260px;
    flex: 0 0 260px;
    background: var(--surface-strong);
    border-right: 1px solid var(--line);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
}
.dashboard-sidebar nav {
    display: grid;
    gap: 0.35rem;
}
.dashboard-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.dashboard-sidebar a:hover {
    background: var(--bg);
    color: var(--ink);
}
.dashboard-sidebar a.is-active {
    background: var(--accent);
    color: var(--ink);
    font-weight: 600;
}
.dashboard-main {
    flex: 1;
    min-width: 0;
    padding: 2rem;
}
.dashboard-section {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.dashboard-section h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--ink);
}
.dashboard-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.1rem;
    margin-bottom: 0.8rem;
}
.dashboard-card:last-child {
    margin-bottom: 0;
}
.dashboard-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    color: var(--ink);
}
.dashboard-card p {
    margin: 0.15rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.dashboard-empty {
    color: var(--muted);
    padding: 0.5rem 0;
}
/* Recommended guide card */
.recommended-guide-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1.25rem;
}
.recommended-guide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}
.recommended-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
}
.recommended-guide-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.recommended-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--line);
    flex-shrink: 0;
}
.recommended-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 700;
}
.recommended-guide-info h3 {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    color: var(--ink);
}
.recommended-rating {
    margin: 0 0 0.35rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
}
.recommended-meta {
    margin: 0.1rem 0;
    color: var(--muted);
    font-size: 0.88rem;
}
.recommended-guide-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}
.recommended-guide-actions .dashboard-btn {
    flex: 1;
    justify-content: center;
}

/* Compact booking rows */
.booking-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    margin-bottom: 0.6rem;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: inherit;
}
.booking-row:last-child { margin-bottom: 0; }
.booking-row:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.booking-row-main h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--ink);
}
.booking-row-main p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.booking-row-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Conversation previews */
.message-row {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.message-row:last-child { margin-bottom: 0; }
.message-row:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.message-row-unread { border-left: 4px solid var(--accent); }
.message-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}
.message-row-head h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.message-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.message-time {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}
.message-preview {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Notification rows */
.notification-icon { color: var(--muted); }
.notification-content { flex: 1; margin: 0; }
.notification-body {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink);
}
.notification-time {
    color: var(--muted);
    font-size: 0.78rem;
}
.notification-unread {
    border-left: 4px solid var(--accent);
}

.dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.dashboard-btn:hover {
    background: var(--accent-deep);
    color: #fff;
    transform: translateY(-2px);
}
.dashboard-btn.secondary {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}
.dashboard-btn.secondary:hover {
    border-color: var(--accent);
    background: var(--surface-strong);
    color: var(--ink);
}
.dashboard-btn.small {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}
.dashboard-btn.danger {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
}
.dashboard-btn.danger:hover {
    background: rgba(231, 76, 60, 0.1);
}
.dashboard-badge {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-tourist { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }
.badge-guide { background: rgba(255, 177, 92, 0.2); color: var(--accent-deep); }
.badge-admin { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.badge-pending { background: rgba(255, 177, 92, 0.2); color: var(--accent-deep); }
.badge-accepted { background: rgba(42, 157, 143, 0.15); color: #2a9d8f; }
.badge-completed { background: rgba(26, 139, 158, 0.15); color: #1a8b9e; }
.badge-cancelled { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.badge-unread { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.dashboard-action {
    display: block;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    padding: 1.25rem;
    text-align: left;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dashboard-action:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.dashboard-action .icon { font-size: 1.8rem; color: var(--accent); }
.dashboard-action .icon svg { width: 1.8rem; height: 1.8rem; }

.dashboard-action p { margin: 0.5rem 0 0; font-weight: 600; color: var(--ink); }
.dashboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dashboard-hero {
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    border-radius: 1.5rem;
    padding: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
}
.dashboard-hero h1 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}
.dashboard-hero p {
    margin: 0.5rem 0 1.25rem;
    opacity: 0.95;
}
.dashboard-hero .dashboard-btn {
    background: #fff;
    color: var(--accent-deep);
}
.dashboard-hero .dashboard-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
}
.dashboard-hero .dashboard-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}
.credit-balance {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-deep);
    margin: 0.25rem 0;
}
.credit-used { color: var(--muted); font-size: 0.9rem; }
.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
}

.signin-prompt {
    text-align: center;
    padding: 4rem 1rem;
}
.signin-prompt h2 { font-size: 1.6rem; color: var(--ink); }
.signin-prompt p { color: var(--muted); margin-bottom: 1.5rem; }
.hidden { display: none !important; }
@media (max-width: 900px) {
    /* Only hide the desktop rail (direct child of .dashboard-shell)
       so the .dashboard-sidebar inside the mobile drawer stays visible. */
    .dashboard-shell > .dashboard-sidebar {
        display: none;
    }
    .dashboard-main {
        padding: 1.25rem;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 640px) {
    .dashboard-main {
        padding: 1rem;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }
    .dashboard-hero {
        padding: 1.5rem;
    }
    .dashboard-section {
        padding: 1.25rem;
    }
    .dashboard-topbar {
        flex-wrap: wrap;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
