/* User-side specific styles layered on top of shared admin header assets */

:root {
    --card-bg: var(--surface-1, #ffffff);
    --card-border: var(--border-subtle, #e5e7eb);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --text-muted: #6b7280;
}

.main-content {
    background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0));
}

.home-hero {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: flex-end;
    padding-top: 0;
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.65)),
                      url('../images/qc-hero.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    color: #ffffff;
}

.home-hero .sub-container {
    position: relative;
    z-index: 1;
}

.home-hero h1 {
    font-size: 2.1rem;
    text-shadow: 0 3px 12px rgba(0,0,0,0.6);
}

.home-hero .hero-subtitle {
    margin-top: 0.4rem;
    max-width: 52rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.home-emergency-cta {
    display: flex;
    justify-content: center;
    padding: 1.75rem 0 1rem;
}

.emergency-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.8rem;
    font-size: 1.05rem;
}

.emergency-call-btn i {
    font-size: 1.2rem;
}

.emergency-guide-list {
    padding-left: 1.25rem;
    line-height: 1.6;
}

.emergency-guide-list li + li {
    margin-top: 0.5rem;
}

/* Language modal */
.language-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1600;
}

.language-modal {
    width: 420px;
    max-width: 90%;
    background: var(--card-bg);
    border-radius: 18px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    border: 1px solid var(--card-border);
}

.language-modal h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.language-modal p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.language-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.language-buttons .btn {
    flex: 1;
}

.language-search input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    margin-bottom: 0.5rem;
}

.language-search ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 160px;
    overflow-y: auto;
}

.language-search li {
    padding: 0.35rem 0.25rem;
    cursor: pointer;
    border-radius: 6px;
}

.language-search li:hover {
    background: rgba(0,0,0,0.05);
}

[data-theme="dark"] .language-modal {
    background: #181a1f;
    border-color: #313543;
}

[data-theme="dark"] .language-search li:hover {
    background: rgba(255,255,255,0.05);
}

.auth-icons {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 1300;
    display: inline-flex;
    gap: 0.5rem;
}

.auth-icon-link {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: grid;
    place-items: center;
    box-shadow: var(--card-shadow);
    color: inherit;
}

.auth-icon-link i {
    font-size: 1.6rem;
}

.chat-fab {
    position: fixed;
    right: 18px;
    bottom: 86px; /* above theme toggle */
    z-index: 1250;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: none;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.chat-fab i {
    font-size: 1.3rem;
    color: #222222;
}

.chat-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 1.5rem 1.5rem;
    z-index: 1400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.chat-modal-open {
    opacity: 1;
    pointer-events: auto;
}

.chat-modal-content {
    width: 420px;
    max-width: 100%;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.chat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--card-border);
}

.chat-modal-header h3 {
    margin: 0;
    font-size: 1rem;
}

.chat-close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    font-size: 1.1rem;
}

.chat-modal-body {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    min-height: 120px;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.25rem 0;
    border-radius: 8px;
    background: rgba(0,0,0,0.02);
}

.chat-message {
    font-size: 0.9rem;
    padding: 0.4rem 0.5rem;
}

.chat-message + .chat-message {
    margin-top: 0.25rem;
}

.chat-message-user {
    text-align: right;
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.chat-input-row input[type="text"] {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

/* Auth forms */
.auth-form {
    max-width: 520px;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.auth-form input,
.auth-form textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.form-group-half {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.auth-switch {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.auth-switch a {
    font-weight: 500;
}

[data-theme="dark"] .chat-modal-content {
    background: #181a1f;
    border-color: #313543;
}

[data-theme="dark"] .chat-messages {
    background: rgba(255,255,255,0.03);
}

[data-theme="dark"] .chat-fab {
    background: #1f2228;
    border-color: #3a3f4b;
}

[data-theme="dark"] .chat-fab i {
    color: #ffffff;
}

@media (max-width: 640px) {
    .chat-modal {
        padding: 0.5rem;
        align-items: flex-end;
        justify-content: center;
    }

    .chat-modal-content {
        width: 100%;
    }
}

.page-content {
    margin: 2.5rem 0;
}

.page-content h2 {
    margin-bottom: 0.75rem;
}

.page-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.card h3,
.card h4 {
    margin: 0;
}

.card p {
    margin: 0;
    color: var(--text-muted);
}

.card .btn {
    margin-top: 0.75rem;
    align-self: flex-start;
}

.content-main {
    width: 100%;
}

.sidebar-toggle-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    box-shadow: var(--card-shadow);
    cursor: pointer;
}

.sidebar-toggle-btn i {
    font-size: 1rem;
}

@media (min-width: 1024px) {
    .sidebar-toggle-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Floating theme toggle */
.theme-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 0.5rem 0.6rem;
    box-shadow: var(--card-shadow);
    display: inline-flex;
    gap: 0.4rem;
}

.theme-toggle-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

@media (max-width: 640px) {
    .theme-toggle {
        right: 12px;
        bottom: 12px;
    }
}

/* Dark theme palette overrides */
[data-theme="dark"] {
    --card-bg: #1c1c1f;
    --card-border: #2a2d34;
    --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    --text-muted: #cdd3dd;
    --surface-1: #121212;
    --border-subtle: #2a2d34;
}

[data-theme="dark"] body,
[data-theme="dark"] .main-content {
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.03), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(255,255,255,0.02), transparent 30%),
                #0e0f12;
    color: #f2f4f7;
}

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: var(--card-shadow);
}

[data-theme="dark"] .page-content p {
    color: var(--text-muted);
}

[data-theme="dark"] .theme-toggle {
    background: #1a1c1f;
    border-color: #2a2d34;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .theme-toggle-btn {
    color: #e8ecf5;
}

