/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Font Variables */
    --font-primary: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-cursive: 'Cedarville Cursive', cursive;

    /* Light Mode Variables */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --reg-surface: #f2f2fc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #a5b4fc;
    --secondary-color: #94a3b8;
    --background: #0f172a;
    --surface: #1e293b;
    --reg-surface: #151b34;
    --text-primary: #f1f5f9;
    --text-secondary: #454648;
    --border: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

/* * {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--surface);
} */


body, button, input, select, textarea {
    font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 72px; /* Account for fixed header */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header Wrapper */
.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header--scrolled {
    background: rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .header--scrolled {
    background: rgba(30, 41, 59, 0.7);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-container {
    user-select: none;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    width: auto;
}

.nav-container {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.nav-menu {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.nav-menu > *,
.nav-container > * {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.10rem;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

/* Login Button — glass default, solid on hover */
#login-nav-link, #about-nav-link {
    padding: 0.45rem 1.2rem;
    border-radius: 9999px;
    /* border: 1px solid rgba(99, 102, 241, 0.35); */
    background: rgba(99, 102, 241, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--primary-color);
    font-weight: 600;
    width: auto !important;
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
    transition: background 0.25s ease, border-color 0.25s ease,
                color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

#login-nav-link:hover, #about-nav-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

[data-theme="dark"] #login-nav-link, #login-nav-link {
    border-color: rgba(129, 140, 248, 0.4);
    background: rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] #login-nav-link:hover, #login-nav-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* About Nav Link — ghost pill style */
/* 
.nav-about-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.05rem;
    padding: 0.45rem 1.1rem !important;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.22s ease, border-color 0.22s ease,
                color 0.22s ease, box-shadow 0.22s ease;
    width: auto !important;
}

.nav-about-link:hover {
    background: rgba(99, 102, 241, 0.09);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--primary-color);
}

[data-theme="dark"] .nav-about-link:hover {
    background: rgba(129, 140, 248, 0.12);
    border-color: rgba(129, 140, 248, 0.3);
    color: var(--primary-color);
} */

/* Theme Toggle Button — circular glass pill */
#theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    /* border: 1px solid rgba(99, 102, 241, 0.3); */
    background: rgba(99, 102, 241, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 !important;
    transition: background 0.25s ease, border-color 0.25s ease,
                box-shadow 0.25s ease, transform 0.25s ease;
}

#theme-toggle:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

[data-theme="dark"] #theme-toggle {
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] #theme-toggle:hover {
    background: rgba(129, 140, 248, 0.22);
    border-color: var(--primary-color);
}

/* Auth Cached States */
html.auth-cached-logged-in #login-nav-link,
html.auth-cached-logged-in #theme-toggle,
html.auth-cached-logged-in #about-nav-link {
    display: none !important;
}

html.auth-cached-logged-in #profile-link {
    display: block !important;
}

/* Welcome Modal Styles */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.welcome-modal-content {
    background: var(--surface);
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 420px;
    width: 90%;
    border: 1px solid var(--border);
}

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

.welcome-icon-wrapper {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
    font-size: 44px;
    line-height: 1;
}

.welcome-icon-wrapper .wave-emoji {
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
    display: inline-block;
}

@keyframes wave-animation {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.welcome-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.welcome-modal-title span {
    color: var(--primary-color);
}

.welcome-modal-text {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    font-size: 1.05rem;
}

.welcome-modal-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.welcome-modal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
}

.welcome-modal-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.welcome-modal-btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.welcome-modal-btn-secondary:hover {
    background: var(--background);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}


.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 1px;
}

/* Profile Link Styles */
.profile-link {
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.profile-img-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.profile-img-btn:hover .profile-img,
.profile-link:hover .profile-img {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* Profile Dropdown Styles */
.profile-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

[data-theme="dark"] .profile-dropdown {
    background: rgba(30, 41, 59, 0.85);
}

.profile-dropdown.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.dropdown-action-btn:hover {
    color: var(--primary-color);
}

.saved-projects-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
}

.saved-projects-list li {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.saved-projects-list li:hover {
    background-color: var(--background);
}

.saved-projects-list li:last-child {
    border-bottom: none;
}

.saved-project-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
    text-decoration: none;
}

.saved-project-title:hover {
    color: var(--primary-color);
}

.unsave-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.unsave-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.empty-state {
    padding: 1.5rem !important;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    justify-content: center !important;
}

.dropdown-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background-color: var(--background);
    text-align: center;
}

.dropdown-footer-link {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.dropdown-footer-link:hover {
    color: var(--secondary-color);
}

/* Custom Scrollbar for dropdown */
.saved-projects-list::-webkit-scrollbar {
    width: 6px;
}

.saved-projects-list::-webkit-scrollbar-track {
    background: transparent;
}

.saved-projects-list::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
}

/* Saved Project Card Styles for Dashboard */
#saved-projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.saved-project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.saved-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.saved-card-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.saved-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.saved-card-authors {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.saved-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}

.saved-card-view-btn {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.saved-card-view-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.saved-card-remove-btn {
    padding: 0.5rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-card-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.saved-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.saved-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.saved-empty-link {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.75rem;
    background: var(--surface);
    color: var(--primary-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.saved-empty-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}



/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    transition: all 0.75s ease;
}

.theme-toggle-btn:hover {
    background-color: var(--border);
}

/* Search Section - Modern Sky Inspired */
.search-section {
    padding: 5rem 0 8rem 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg,
            #1e3a8a 0%,
            #1e40af 25%,
            #3b82f6 50%,
            #60a5fa 75%,
            #93c5fd 100%);
}

.search-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(248, 250, 252, 0) 0%,
            var(--background) 100%);
    z-index: 1;
    pointer-events: none;
}

[data-theme="dark"] .search-section {
    background: linear-gradient(135deg,
            #0f172a 0%,
            #1e293b 25%,
            #1e3a8a 50%,
            #312e81 75%,
            #4c1d95 100%);
}

[data-theme="dark"] .search-section::after {
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(15, 23, 42, 0) 0%,
            var(--background) 100%);
}

.search-container {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.search-title {
    user-select: none;
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-subtitle {
    user-select: none;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.search-bar-wrapper {
    margin-bottom: 1.5rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: transparent;
}

.search-input::placeholder {
    color: var(--text-secondary);
}


.search-btn {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* AI Search Toggle */
.search-options {
    display: flex;
    justify-content: center;
}

.ai-search-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
    /* Prevent text selection */
}

.ai-toggle-input {
    display: none;
}

.ai-toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    transition: background-color 0.3s ease-out;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    /* Only slider is clickable */
}

.ai-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ai-toggle-input:checked+.ai-toggle-slider {
    background-color: var(--primary-color);
}

.ai-toggle-input:checked+.ai-toggle-slider::after {
    transform: translateX(24px);
}

.ai-toggle-label {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: none;
    /* Label not clickable */
}

.ai-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    pointer-events: none;
    /* Badge not clickable */
}

/* Decorative Elements - Modern Sky */
.deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.deco-circle-1 {
    width: 150px;
    height: 150px;
    top: -30px;
    right: 5%;
    animation: float 6s ease-in-out infinite;
}

.deco-circle-2 {
    width: 100px;
    height: 100px;
    bottom: 20px;
    left: 5%;
    animation: float 8s ease-in-out infinite reverse;
}

.deco-blob {
    position: absolute;
    bottom: -50px;
    right: 10%;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 8s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes morph {

    0%,
    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    50% {
        border-radius: 60% 40% 30% 70% / 60% 40% 70% 30%;
    }
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--background);
    border-color: var(--secondary-color);
}

/* Features Section */
.features {
    padding: 5rem 0;
    background-color: var(--surface);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Password Input Wrapper for Modal */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 3.5rem;
}

.toggle-password-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    border-radius: var(--radius-sm);
}

.toggle-password-btn:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.toggle-password-btn .eye-icon {
    pointer-events: none;
}

/* Field Error Messages */
.field-error {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-left: 3px solid #ef4444;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #ef4444;
    animation: slideInDown 0.3s ease;
}

.field-error.show {
    display: flex;
}

.field-error::before {
    content: '⚠';
    font-size: 1rem;
}

/* Input Error State */
.form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    animation: shake 0.5s ease;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transform: translateY(-20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: var(--border);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider:not(:empty)::before {
    margin-right: .75em;
}

.divider:not(:empty)::after {
    margin-left: .75em;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-input:checked+.checkbox-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-input:checked+.checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-menu {
        gap: 1.25rem;
    }

    .nav-link {
        font-size: 0.875rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .nav-container {
        gap: 0;
    }

    .nav-menu > *,
    .nav-container > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Google Sign-In Button - Full Width */
.login-buttons-row {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.btn-flex {
    flex: 1;
}

.btn-icon {
    padding: 0.875rem;
    min-width: auto;
    width: auto;
}

.btn-google.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1rem;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google.btn-icon:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-google.btn-icon:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-google.btn-icon:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dark mode for icon button */
body.dark-mode .btn-google.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .btn-google.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-google.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-google {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c6c6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-google:active {
    background: #f1f3f4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.google-icon {
    flex-shrink: 0;
}

/* Dark mode adjustments */
body.dark-mode .btn-google {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .btn-google:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}


/* ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */


/* ── Profile Dropdown ── */
.profile-dropdown-wrapper {
    position: relative;
    display: none; /* hidden by default; shown when logged in */
}

/* Allow auth-cached logic to override the display */
html.auth-cached-logged-in .profile-dropdown-wrapper {
    display: block !important;
}

.profile-img-trigger {
    display: block;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: box-shadow 0.25s, border-color 0.25s;
}

.profile-img-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.profile-img-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-dropdown-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 200;
}

.profile-dropdown-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.pd-avatar {
    display: flex;
    justify-content: center;
    padding: 1.25rem 1rem 0.75rem;
}

.pd-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.pd-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.pd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    gap: 0.75rem;
    transition: background 0.18s;
}

.pd-row:hover {
    background: var(--border);
}

.pd-row-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pd-row-label svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Theme toggle inside dropdown */
.pd-theme-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 9999px;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.25s;
    flex-shrink: 0;
}

.pd-theme-toggle.dark-on {
    background: var(--primary-color);
}

.pd-theme-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
}

.pd-theme-toggle.dark-on::after {
    transform: translateX(18px);
}

/* Logout row */
.pd-logout-row {
    padding: 0.85rem 1.1rem;
}

.pd-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.06);
    color: #ef4444;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    transition: background 0.2s, border-color 0.2s;
}

.pd-logout-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* Custom Font Utility Classes */
.atkinson-hyperlegible-regular {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.atkinson-hyperlegible-bold {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-weight: 700;
  font-style: normal;
}

.atkinson-hyperlegible-regular-italic {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-weight: 400;
  font-style: italic;
}

.atkinson-hyperlegible-bold-italic {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-weight: 700;
  font-style: italic;
}

.cedarville-cursive-regular {
  font-family: "Cedarville Cursive", cursive;
  font-weight: 400;
  font-style: normal;
}

