/* Minimal theme button styling */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #4b5563;
    padding: 6px;
    margin-left: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

/* Global Nav Layout Overrides */
.logo {
    margin-right: auto !important;
}

@media (min-width: 769px) {
    .nav-links {
        margin-right: 2rem !important;
    }
}

@media (max-width: 768px) {
    .logo {
        margin-right: 0 !important;
    }

    .theme-toggle-btn {
        margin: 0 !important;
        position: absolute !important;
        right: 5%;
        top: 22px;
        /* Roughly aligned with mobile menu vertically */
    }
}

.theme-toggle-btn:hover {
    background-color: #f3f4f6;
    color: #e11d48;
}

html.dark-mode .theme-toggle-btn {
    color: #d1d5db;
}

html.dark-mode .theme-toggle-btn:hover {
    background-color: #374151;
    color: #e11d48;
}

::view-transition-group(root) {
    animation-duration: 0.6s;
    animation-timing-function: ease-in-out;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

html.dark-mode::view-transition-old(root) {
    z-index: 1;
}

html.dark-mode::view-transition-new(root) {
    z-index: 9999;
}

/* Going back to light mode, place light on top */
html:not(.dark-mode)::view-transition-old(root) {
    z-index: 1;
}

html:not(.dark-mode)::view-transition-new(root) {
    z-index: 9999;
}

/* DARK MODE STYLES */
html.dark-mode body {
    background-color: #111827 !important;
    color: #f3f4f6 !important;
}

html.dark-mode nav {
    background: rgba(17, 24, 39, 0.95) !important;
    border-bottom: 1px solid #374151 !important;
}

html.dark-mode .nav-links a {
    color: #d1d5db !important;
}

html.dark-mode .nav-links a:hover,
html.dark-mode .nav-links a.active {
    color: #e11d48 !important;
}

html.dark-mode .logo span,
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3 {
    color: #f9fafb !important;
}

html.dark-mode .hero {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
}

html.dark-mode .feature-card,
html.dark-mode .card,
html.dark-mode .dashboard-section,
html.dark-mode .setup-card,
html.dark-mode .req-card,
html.dark-mode .step-card,
html.dark-mode .why-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

html.dark-mode .process-tabs {
    background: #1f2937 !important;
}

html.dark-mode .process-tabs .tab-btn {
    color: #9ca3af !important;
}

html.dark-mode .process-tabs .tab-btn:hover {
    color: #f3f4f6 !important;
}

html.dark-mode .process-tabs .tab-btn.active {
    background: #374151 !important;
    color: #e11d48 !important;
    box-shadow: none !important;
}

html.dark-mode .why-card h3,
html.dark-mode .step-card h3 {
    color: #f9fafb !important;
}

html.dark-mode .why-card p,
html.dark-mode .step-card p {
    color: #d1d5db !important;
}

html.dark-mode .feature-icon {
    background: #374151 !important;
}

html.dark-mode footer {
    background: #111827 !important;
    color: #9ca3af !important;
    border-top: 1px solid #374151 !important;
}

html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea {
    background: #374151 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

html.dark-mode .public-stats-box {
    border-color: #374151 !important;
}

html.dark-mode .public-stats-box div[style*="background: #e5e7eb;"] {
    background: #374151 !important;
}

html.dark-mode .mobile-menu-btn {
    color: #f3f4f6 !important;
}

html.dark-mode .amount-box {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

html.dark-mode .amount-box strong {
    color: #f9fafb !important;
}

html.dark-mode .req-details,
html.dark-mode .subtitle,
html.dark-mode p {
    color: #d1d5db !important;
}

html.dark-mode .req-meta {
    border-color: #374151 !important;
    border-top: 1px solid #374151 !important;
    border-bottom: 1px solid #374151 !important;
}

html.dark-mode .req-meta strong {
    color: #f9fafb !important;
}

html.dark-mode .badge,
html.dark-mode .req-badge {
    background: #9f1239 !important;
    color: #fca5a5 !important;
}

html.dark-mode .tab.active {
    color: #e11d48 !important;
    border-bottom-color: #e11d48 !important;
}

html.dark-mode .tab {
    color: #9ca3af !important;
}

html.dark-mode .tab:hover {
    color: #d1d5db !important;
}

html.dark-mode .tabs {
    border-bottom-color: #374151 !important;
}

/* Tutor Dynamic Status Panels overrides */
/* Specifically target the div panels inside req-card by their inline background colors */
html.dark-mode .req-card div[style*="background: #fffpeb"],
/* Demo Required Light Bg */
html.dark-mode .req-card div[style*="background: #fef3c7"],
/* Awaiting Payment Light Bg */
html.dark-mode .req-card div[style*="background: #ecfdf5"]

/* Paid Light Bg */
    {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

html.dark-mode .req-card h4[style*="color: #92400e"],
/* Demo/Pending Header */
html.dark-mode .req-card h4[style*="color: #065f46"]

/* Paid Header */
    {
    color: #f9fafb !important;
}

html.dark-mode .req-card p[style*="color: #b45309"],
/* Demo/Pending Text */
html.dark-mode .req-card p[style*="color: #047857"]

/* Paid Text */
    {
    color: #cbd5e1 !important;
}

html.dark-mode .req-card div[style*="background: #eff6ff"] {
    background: #1e3a8a !important;
    border-color: #1e40af !important;
}

html.dark-mode .req-card div[style*="background: #eff6ff"] p[style*="color: #1e40af"] {
    color: #93c5fd !important;
}

html.dark-mode .req-card div[style*="background: #eff6ff"] p[style*="color: #1e3a8a"] {
    color: #fbfccb !important;
}

html.dark-mode .req-card div[style*="background: #eff6ff"] p[style*="color: #1e3a8a"] {
    color: #eff6ff !important;
}

html.dark-mode .detail-bubble,
html.dark-mode .phone-badge {
    background-color: #374151 !important;
    color: #d1d5db !important;
    border-color: #4b5563 !important;
}

html.dark-mode .step-card,
html.dark-mode .faq-item {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

html.dark-mode .faq-question h3,
html.dark-mode .card h2 {
    color: #f9fafb !important;
}

/* Parent Dynamic Status Panels overrides */
/* Specifically target the div panels inside req-card by their inline background colors */
html.dark-mode .req-card div[style*="background: #fef3c7"],
/* Awaiting Payment Light Bg */
html.dark-mode .req-card div[style*="background: #ecf5"],
/* Assigned Tutor Light Bg */
html.dark-mode .req-card div[style*="background: #f9fafb"],
/* Feedback Box Light Bg */
html.dark-mode .req-card div[style*="background:#fffbeb"]

/* Tutor Feedback Container Light Bg */
    {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* Empty Map State */
html.dark-mode .req-card div[style*="border: 1px dashed"] {
    background: #1f2937 !important;
    border-color: #4b5563 !important;
}

html.dark-mode .req-card div[style*="border: 1px dashed"] p {
    color: #9ca3af !important;
}

/* Edit Requirement button in Pending status */
html.dark-mode .req-card button[style*="background:#f3f4f6"] {
    background: #374151 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

html.dark-mode .req-card button[style*="background:#f3f4f6"]:hover {
    background: #4b5563 !important;
}

html.dark-mode .req-card h4[style*="color: #92400e"],
/* Pending Header */
html.dark-mode .req-card h4[style*="color: #065f46"],
/* Paid Header */
html.dark-mode .req-card h4[style*="color: #374151"],
/* Feedback Header */
html.dark-mode .req-card p[style*="color: #92400e"]

/* Feedback Box Title */
    {
    color: #f9fafb !important;
}

html.dark-mode .req-card p[style*="color: #b45309"],
/* Pending Text */
html.dark-mode .req-card p[style*="color: #047857"],
/* Paid Text */
html.dark-mode .req-card p[style*="color: #4b5563"]

/* Feedback Text */
    {
    color: #cbd5e1 !important;
}

/* Feedback specific items (the pill bubbles) */
html.dark-mode .req-card span[style*="background:#fef3c7"],
html.dark-mode .req-card span[style*="background: #fef3c7"] {
    background: #374151 !important;
    color: #f3f4f6 !important;
    border: 1px solid #4b5563 !important;
}

html.dark-mode .faq-answer {
    color: #cbd5e1 !important;
}

/* Form Labels and Inputs */
html.dark-mode .input-group[style*="flex-direction: row"],
html.dark-mode .input-group[style*="flex-direction:row"] {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

html.dark-mode .input-group label {
    color: #e5e7eb !important;
}

html.dark-mode .input-group input,
html.dark-mode .input-group select,
html.dark-mode .input-group textarea {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

html.dark-mode .input-group input:focus,
html.dark-mode .input-group select:focus,
html.dark-mode .input-group textarea:focus {
    border-color: #e11d48 !important;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.25) !important;
}

/* About Page Specific Overrides */
html.dark-mode .page-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #1e1b4b 100%) !important;
    border-bottom: 1px solid #374151 !important;
}

html.dark-mode .page-header p {
    color: #cbd5e1 !important;
}

html.dark-mode .page-header .badge {
    background: #3f1d38 !important;
    /* Darker red tint */
    border-color: #9f1239 !important;
    color: #fda4af !important;
}

html.dark-mode .btn-secondary {
    background: #1f2937 !important;
    color: #f3f4f6 !important;
    border-color: #4b5563 !important;
}

html.dark-mode .btn-secondary:hover {
    background: #374151 !important;
    border-color: #6b7280 !important;
}

html.dark-mode .why-section {
    background: #111827 !important;
    border-top: 1px solid #374151 !important;
}

html.dark-mode .section-label h2 {
    color: #f9fafb !important;
}

html.dark-mode .section-label p {
    color: #d1d5db !important;
}

html.dark-mode .cta-section {
    background: #0f172a !important;
    /* Keep it dark in dark mode */
    border-top: 1px solid #1f2937 !important;
}

html.dark-mode .cta-section h2,
html.dark-mode .cta-section p {
    color: #f3f4f6 !important;
}

/* Base Light Mode CTA Styles - these override about.html's hardcoded dark colors */
html:not(.dark-mode) .cta-section {
    background: linear-gradient(135deg, #fff1f2 0%, #fdf2f8 50%, #eff6ff 100%) !important;
    color: #111827 !important;
}

html:not(.dark-mode) .cta-section h2 {
    color: #111827 !important;
}

html:not(.dark-mode) .cta-section p {
    color: #4b5563 !important;
}

html:not(.dark-mode) .btn-cta-secondary {
    background: white !important;
    color: #374151 !important;
    border-color: #e5e7eb !important;
}

html:not(.dark-mode) .btn-cta-secondary:hover {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
}

html.dark-mode .stat-card {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

html.dark-mode .admin-header {
    background: #111827 !important;
    border-bottom: 1px solid #374151 !important;
}

/* --- Dotted Background Pattern --- */
body {
    background-color: #F8F9FA !important;
    background-image: radial-gradient(#d1d5db 1px, transparent 1px) !important;
    background-size: 20px 20px !important;
}

html.dark-mode body {
    background-color: #111827 !important;
    background-image: radial-gradient(#374151 1px, transparent 1px) !important;
    background-size: 20px 20px !important;
}

/* --- Glassmorphism Panels --- */
.card,
.req-card,
.feature-card,
.dashboard-section,
.setup-card,
.stat-card,
.admin-card,
.info-panel {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px;
}

html.dark-mode .card,
html.dark-mode .req-card,
html.dark-mode .feature-card,
html.dark-mode .dashboard-section,
html.dark-mode .setup-card,
html.dark-mode .stat-card,
html.dark-mode .admin-card,
html.dark-mode .info-panel {
    background: rgba(31, 41, 55, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(75, 85, 99, 0.4) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2) !important;
}

/* --- Liquid Glass Modal --- */
.glass-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.glass-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.glass-modal {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

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

html.dark-mode .glass-modal {
    background: rgba(31, 41, 55, 0.85) !important;
    border: 1px solid rgba(75, 85, 99, 0.5) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

.glass-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

html.dark-mode .glass-modal-title {
    color: #f9fafb;
}

.glass-modal-message {
    font-size: 14.5px;
    color: #4b5563;
    margin-bottom: 24px;
    line-height: 1.5;
}

html.dark-mode .glass-modal-message {
    color: #cbd5e1;
}

.glass-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.glass-modal-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    flex: 1;
}

.glass-modal-btn-primary {
    background: #e11d48;
    color: white;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
}

.glass-modal-btn-primary:hover {
    background: #be123c;
    box-shadow: 0 4px 12px rgba(190, 18, 60, 0.3);
}

.glass-modal-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.glass-modal-btn-secondary:hover {
    background: #e5e7eb;
}

html.dark-mode .glass-modal-btn-secondary {
    background: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}

html.dark-mode .glass-modal-btn-secondary:hover {
    background: #4b5563;
}

html.dark-mode #edit-profile-btn svg {
    stroke: #f3f4f6;
}