/* ============================================
   Learn With Lorna - Dashboard Styles
   Extends the main styles.css design system
   ============================================ */

:root {
    --green: #4a9e6b;
    --green-light: #e8f5ec;
    --yellow: #d4a843;
    --yellow-light: #fdf5e0;
    --red: #c45a42;
    --red-light: #fde8e4;
}

/* --- Login Page --- */
.login-page {
    background: var(--cream);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    text-align: center;
}

.login-logo img {
    height: 52px;
    margin-bottom: 24px;
    image-rendering: auto;
}

.login-card h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-light);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.login-tabs {
    display: flex;
    background: var(--cream);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.login-tab.active {
    background: var(--white);
    color: var(--brown);
    box-shadow: var(--shadow-sm);
}

.login-error {
    background: var(--red-light);
    color: var(--red);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    text-align: left;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--brown);
    margin-bottom: 6px;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(224, 120, 96, 0.15);
}

.login-form select {
    cursor: pointer;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--cream-dark);
}

.login-divider span {
    padding: 0 16px;
}

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 50px;
    background: var(--white);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google:hover {
    border-color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

.login-footer-text {
    margin-top: 24px;
    font-size: 0.85rem;
}

.login-footer-text a {
    color: var(--coral);
    text-decoration: none;
}

.login-footer-text a:hover {
    text-decoration: underline;
}

/* --- Dashboard Layout --- */
.dash-body {
    background: var(--cream);
    min-height: 100vh;
}

.dash-nav {
    background: var(--white);
    border-bottom: 1px solid var(--cream-dark);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.dash-nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.dash-nav-logo img {
    height: 52px;
    image-rendering: auto;
}

.dash-nav-links {
    display: flex;
    gap: 4px;
}

.dash-nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-family: 'Inter', sans-serif;
}

.dash-nav-link:hover,
.dash-nav-link.active {
    color: var(--coral);
    background: rgba(224, 120, 96, 0.08);
}

.dash-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-nav-user {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--brown);
}

.dash-nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.dash-nav-logout {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--cream-dark);
    background: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dash-nav-logout:hover {
    border-color: var(--coral);
    color: var(--coral);
}

/* --- Main Content --- */
.dash-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.dash-header {
    margin-bottom: 32px;
}

.dash-header h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.dash-header p {
    color: var(--text-light);
}

/* --- Stats Row --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brown);
}

.stat-card .stat-value.coral { color: var(--coral); }
.stat-card .stat-value.green { color: var(--green); }

/* --- Cards --- */
.dash-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.dash-card:hover {
    box-shadow: var(--shadow-md);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.dash-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brown);
}

.dash-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dash-card-desc {
    color: var(--text-light);
    font-size: 0.93rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.dash-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-pending {
    background: var(--yellow-light);
    color: var(--yellow);
}

.badge-submitted {
    background: rgba(224, 120, 96, 0.12);
    color: var(--coral);
}

.badge-reviewed {
    background: var(--green-light);
    color: var(--green);
}

.badge-subject {
    background: var(--cream);
    color: var(--brown-light);
}

.badge-type {
    background: var(--cream-dark);
    color: var(--brown-light);
}

/* --- Buttons (dashboard-specific) --- */
.btn-sm {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-coral {
    background: var(--coral);
    color: var(--white);
}

.btn-coral:hover {
    background: var(--coral-dark);
}

.btn-outline {
    background: none;
    border: 1.5px solid var(--cream-dark);
    color: var(--text-light);
}

.btn-outline:hover {
    border-color: var(--coral);
    color: var(--coral);
}

.btn-green {
    background: var(--green);
    color: var(--white);
}

.btn-green:hover {
    background: #3d8a5b;
}

.btn-danger {
    background: none;
    border: 1.5px solid var(--red-light);
    color: var(--red);
}

.btn-danger:hover {
    background: var(--red-light);
}

/* --- Tab Navigation --- */
.tab-container {
    margin-bottom: 32px;
}

.tab-nav {
    display: flex;
    gap: 4px;
    background: var(--white);
    padding: 4px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--coral);
    color: var(--white);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* --- Forms (dashboard) --- */
.dash-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 32px;
    margin-bottom: 24px;
}

.dash-form h3 {
    margin-bottom: 20px;
}

.dash-form .form-group {
    margin-bottom: 16px;
}

.dash-form label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--brown);
    margin-bottom: 6px;
}

.dash-form input,
.dash-form select,
.dash-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-form input:focus,
.dash-form select:focus,
.dash-form textarea:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(224, 120, 96, 0.15);
}

.dash-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.checkbox-item:has(input:checked) {
    border-color: var(--coral);
    background: rgba(224, 120, 96, 0.06);
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    accent-color: var(--coral);
}

/* --- File Upload --- */
.file-upload {
    border: 2px dashed var(--cream-dark);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload:hover {
    border-color: var(--coral);
    background: rgba(224, 120, 96, 0.03);
}

.file-upload p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.file-upload .file-name {
    color: var(--coral);
    font-weight: 500;
    margin-top: 8px;
}

/* --- Submission / Review --- */
.submission-area {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
}

.submission-area textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    resize: vertical;
}

.submission-area textarea:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(224, 120, 96, 0.15);
}

.review-box {
    background: var(--green-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
}

.review-box h4 {
    color: var(--green);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.review-box .grade {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 8px;
}

.review-box .feedback {
    color: var(--text);
    font-size: 0.93rem;
    line-height: 1.6;
}

/* --- Loading, Toast, Empty States --- */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px;
    color: var(--text-light);
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--cream-dark);
    border-top-color: var(--coral);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

.error-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--red);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--green);
    color: var(--white);
}

.toast-error {
    background: var(--red);
    color: var(--white);
}

/* --- Tables (admin) --- */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.dash-table th {
    background: var(--cream);
    text-align: left;
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.dash-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--cream);
    font-size: 0.93rem;
}

.dash-table tr:hover td {
    background: rgba(253, 246, 240, 0.5);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 50, 40, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.3rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--cream);
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--cream-dark);
    color: var(--text);
}

/* --- Mobile Hamburger for Dashboard --- */
.dash-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.dash-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--brown);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .dash-nav {
        padding: 0 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dash-toggle {
        display: block;
    }

    .dash-nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px;
        box-shadow: var(--shadow-md);
        flex-direction: column;
    }

    .dash-nav-links.open {
        display: flex;
    }

    .dash-nav-user {
        display: none;
    }

    .login-card {
        padding: 32px 24px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-content {
        padding: 20px 16px;
    }

    .dash-form {
        padding: 20px;
    }

    .modal {
        width: 95%;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .dash-card-actions {
        flex-direction: column;
    }

    .dash-card-actions .btn-sm {
        width: 100%;
        justify-content: center;
    }
}

/* --- Enquiry Badge --- */
.enquiry-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
    line-height: 1;
}

/* --- Enquiry Cards --- */
.enquiry-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 12px;
    border-left: 4px solid var(--coral);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.enquiry-card.is-read {
    border-left-color: var(--cream-dark);
    opacity: 0.75;
}

.enquiry-card:hover {
    opacity: 1;
    box-shadow: var(--shadow-md);
}

.enquiry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.enquiry-card-header h4 {
    font-size: 1rem;
    margin: 0;
}

.enquiry-card-header small {
    color: var(--text-light);
    font-size: 0.8rem;
    white-space: nowrap;
}

.enquiry-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.enquiry-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.enquiry-message {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.enquiry-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
