* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.25s ease, color 0.25s ease;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
    transition:
        opacity 0.65s ease,
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    .reveal-on-scroll.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Existing styles */
.title1 {
    color: rgb(1, 0, 84);
}

.button1 {
    background-color: rgb(0, 0, 0);
    color: white;
    border-radius: 5px;
    width: 85px;
    height: 40px;
    text-align: center;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.pt-1 { padding-top: 10px; }
.pt-2 { padding-top: 20px; }
.pt-3 { padding-top: 30px; }

.pb-1 { padding-bottom: 10px; }
.pb-2 { padding-bottom: 20px; }
.pb-3 { padding-bottom: 30px; }

/* Authentication States */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

/* Global Navbar / Header */
#user-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-footer {
    width: min(1180px, calc(100% - 24px));
    margin: 36px auto 24px;
    padding: 28px 24px 18px;
    border-radius: 24px;
    background: rgba(255, 250, 242, 0.78);
    border: 1px solid rgba(24, 32, 51, 0.08);
    box-shadow: 0 18px 40px rgba(18, 24, 40, 0.08);
    backdrop-filter: blur(14px);
}

.site-footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}

.site-footer-brand {
    max-width: 380px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-mark {
    width: 56px;
    height: 56px;
    object-fit: cover;
    object-position: center 9%;
    flex: 0 0 auto;
    border-radius: 18px;
    filter: drop-shadow(0 10px 18px rgba(255, 112, 26, 0.24));
}

.brand-text {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.site-footer-title {
    color: #182033;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0;
}

.site-footer-kicker {
    color: #8d4f20;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-footer-copy {
    color: #5a6476;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 14px;
}

.site-footer-columns {
    display: flex;
    align-items: flex-start;
    gap: 34px;
    flex-wrap: wrap;
}

.site-footer-column {
    min-width: 170px;
}

.site-footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.site-footer-links a {
    color: #24304d;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

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

.site-footer-label {
    color: #6a7488;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-footer-bottom {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(24, 32, 51, 0.08);
    color: #6a7488;
    font-size: 13px;
}

.navbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 10px auto 0;
    width: min(1180px, calc(100% - 24px));
    border-radius: 18px;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 143, 61, 0.34), transparent 22%),
        radial-gradient(circle at 85% 25%, rgba(97, 59, 220, 0.28), transparent 26%),
        linear-gradient(135deg, rgba(37, 18, 69, 0.96) 0%, rgba(30, 38, 88, 0.94) 44%, rgba(198, 76, 16, 0.88) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(31, 20, 53, 0.22);
    backdrop-filter: blur(14px);
}

.navbar-left,
.navbar-center,
.navbar-right {
    display: flex;
    align-items: center;
}

.navbar-left {
    min-width: 0;
}

.navbar-center {
    min-width: 0;
    justify-content: center;
}

.navbar-right {
    min-width: 0;
    gap: 14px;
    justify-content: flex-end;
}

.navbar h2 {
    margin: 0;
    font-size: 24px;
    cursor: pointer;
}

.navbar-brand {
    color: white;
    text-decoration: none;
    min-width: 0;
}

.navbar-brand:hover {
    opacity: 0.92;
}

.brand-name {
    color: white;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.brand-kicker {
    color: rgba(255, 232, 214, 0.84);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.navbar-menu {
    display: flex;
    gap: 6px;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: center;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    padding: 7px 9px;
    font-size: 14px;
    border-radius: 999px;
    transition: opacity 0.25s, background 0.25s, transform 0.25s;
}

.navbar-menu a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.language-selector-wrapper,
.theme-toggle,
.user-profile-menu,
.auth-buttons {
    flex: 0 0 auto;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.language-selector-wrapper {
    margin-right: 0;
    min-width: 76px;
    display: flex;
    align-items: center;
}

#languageSelectorContainer {
    display: flex;
    min-width: 76px;
}

.language-selector-wrapper select {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    outline: none;
    background-image: none;
    min-width: 76px;
}

.language-selector-wrapper select:hover {
    background: rgba(255, 255, 255, 0.3);
}

.language-selector-wrapper select option {
    background: white;
    color: #333;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 12px;
}

.user-email {
    font-size: 10px;
    opacity: 0.9;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.profile-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.25s;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 170px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
    display: none;
    z-index: 1;
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    padding: 12px 18px;
    text-decoration: none;
    display: block;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: #f2f5ff;
}

.profile-dropdown:hover .dropdown-content {
    display: block;
}

.profile-dropdown:focus-within .dropdown-content {
    display: block;
}

.theme-toggle {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 1120px) {
    .navbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .navbar-left,
    .navbar-center,
    .navbar-right {
        width: 100%;
        justify-content: center;
    }

    .navbar-brand {
        justify-content: center;
    }

    .navbar-menu {
        justify-content: center;
        flex-wrap: wrap;
    }

    .navbar-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .navbar-controls,
    .user-profile-menu {
        justify-content: center;
    }

    .user-info {
        text-align: center;
    }
}

.theme-toggle-floating {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    color: #182033;
    border-color: rgba(24, 32, 51, 0.12);
    background: rgba(255, 250, 242, 0.92);
    box-shadow: 0 12px 24px rgba(20, 26, 42, 0.16);
}

.dark-theme {
    color: #e5e7eb;
}

.dark-theme .navbar {
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 132, 40, 0.2), transparent 24%),
        radial-gradient(circle at 82% 22%, rgba(132, 92, 255, 0.16), transparent 26%),
        linear-gradient(135deg, rgba(12, 8, 28, 0.96) 0%, rgba(19, 26, 51, 0.94) 54%, rgba(94, 38, 15, 0.88) 100%);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.dark-theme .language-selector-wrapper select,
.dark-theme .profile-btn,
.dark-theme .theme-toggle {
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.dark-theme .navbar-menu a:hover,
.dark-theme .profile-btn:hover,
.dark-theme .language-selector-wrapper select:hover,
.dark-theme .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.dark-theme .dropdown-content {
    background: #0f172a;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.dark-theme .dropdown-content a {
    color: #e5e7eb;
}

.dark-theme .dropdown-content a:hover {
    background: rgba(148, 163, 184, 0.12);
}

.dark-theme .theme-toggle-floating {
    color: #f5f7fb;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.92);
}

.dark-theme .site-footer {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
}

.dark-theme .site-footer-copy,
.dark-theme .site-footer-label,
.dark-theme .site-footer-bottom {
    color: #94a3b8;
}

.dark-theme .site-footer-title,
.dark-theme .site-footer-links a {
    color: #e5e7eb;
}

.dark-theme .site-footer-kicker {
    color: #fdba74;
}

.dark-theme .site-footer-bottom {
    border-top-color: rgba(148, 163, 184, 0.14);
}

.auth-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.auth-buttons a {
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.25s;
}

.login-btn {
    color: white;
    border: 2px solid white;
    background: transparent;
}

.login-btn:hover {
    background: white;
    color: #667eea;
}

.signup-btn {
    background: linear-gradient(135deg, #ff9c4d 0%, #ff7a21 100%);
    color: white;
    border: 2px solid white;
}

.signup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .navbar {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 14px 16px;
        width: calc(100% - 16px);
        margin-top: 8px;
        border-radius: 18px;
    }

    .navbar-left,
    .navbar-center,
    .navbar-right {
        width: 100%;
        justify-content: center;
    }

    .navbar-menu {
        justify-content: flex-start;
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 10px;
        scrollbar-width: none;
    }

    .navbar-menu::-webkit-scrollbar {
        display: none;
    }

    .navbar-menu a {
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 13px;
    }

    .user-profile-menu {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .language-selector-wrapper {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .auth-buttons {
        width: 100%;
        justify-content: stretch;
        gap: 10px;
    }

    .navbar-right,
    .navbar-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .language-selector-wrapper,
    .language-selector-wrapper select,
    .theme-toggle,
    .profile-btn,
    .auth-buttons a {
        width: 100%;
        text-align: center;
    }

    .user-info {
        text-align: left;
        min-width: 0;
    }

    .site-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-footer-columns {
        width: 100%;
        gap: 20px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .section {
        padding: 40px 0;
    }

    body {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .section {
        padding: 20px 0;
    }

    .container {
        padding: 0 15px;
    }

    .navbar {
        width: calc(100% - 12px);
        margin-top: 6px;
        padding: 12px;
        border-radius: 16px;
    }

    .navbar-brand {
        align-items: center;
    }

    .brand-name,
    .navbar-menu a,
    .login-btn,
    .signup-btn,
    .profile-btn,
    .theme-toggle {
        min-height: 44px;
    }

    .site-footer {
        width: calc(100% - 12px);
        margin: 22px auto 18px;
        padding: 22px 18px 16px;
        border-radius: 20px;
    }

    .site-footer-column,
    .site-footer-brand {
        min-width: 0;
        width: 100%;
    }

    .brand-mark {
        width: 54px;
        height: 54px;
    }
}

@media (max-width: 520px) {
    .brand-kicker,
    .site-footer-kicker {
        display: none;
    }
}

@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .navbar {
            padding-top: max(16px, env(safe-area-inset-top));
        }

        .theme-toggle-floating {
            right: max(18px, env(safe-area-inset-right));
            bottom: max(18px, env(safe-area-inset-bottom));
        }
    }
}

/* Loading and Animations */
.hidden {
    display: none;
}

.visible {
    display: block;
}

.opacity-0 {
    opacity: 0;
}

.opacity-1 {
    opacity: 1;
}

.app-layout {
    width: min(1380px, calc(100% - 24px));
    margin: 22px auto 0;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.app-sidebar {
    position: sticky;
    top: 112px;
    min-height: calc(100vh - 136px);
    padding: 18px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top left, rgba(255, 143, 61, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(97, 59, 220, 0.12), transparent 24%),
        rgba(18, 20, 26, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 70px rgba(6, 8, 14, 0.28);
    color: #f8fafc;
    overflow: hidden;
}

.app-sidebar-inner {
    display: grid;
    gap: 18px;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-sidebar-brand .brand-lockup {
    color: inherit;
}

.app-sidebar-brand .brand-name,
.app-sidebar-brand .brand-kicker {
    color: inherit;
}

.app-sidebar-toggle,
.app-sidebar-close,
.app-action {
    appearance: none;
    border: 0;
    cursor: pointer;
}

.app-sidebar-toggle {
    display: none;
    margin: 12px 0 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(18, 20, 26, 0.92);
    color: #f8fafc;
    box-shadow: 0 14px 34px rgba(6, 8, 14, 0.22);
}

.app-sidebar-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 20px;
}

.app-sidebar-section {
    display: grid;
    gap: 10px;
}

.app-section-title {
    color: rgba(226, 232, 240, 0.54);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.app-action:hover,
.app-action:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    outline: none;
}

.app-action.is-active {
    background: linear-gradient(135deg, rgba(255, 141, 58, 0.18), rgba(97, 59, 220, 0.16));
    border-color: rgba(255, 255, 255, 0.08);
}

.app-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.08);
    color: #ffd9bd;
    font-size: 15px;
    font-weight: 700;
}

.app-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-action-label {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 700;
}

.app-action-meta {
    color: rgba(226, 232, 240, 0.7);
    font-size: 12px;
}

.app-recent-list {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.app-recent-link {
    display: block;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.app-recent-link:hover,
.app-recent-link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.app-recent-link strong,
.app-recent-empty {
    display: block;
    font-size: 14px;
}

.app-recent-link span,
.app-recent-empty {
    color: rgba(226, 232, 240, 0.68);
    font-size: 12px;
    line-height: 1.5;
}

.app-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 130;
}

.app-sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.dark-theme .app-sidebar {
    background:
        radial-gradient(circle at top left, rgba(255, 143, 61, 0.15), transparent 24%),
        radial-gradient(circle at top right, rgba(97, 59, 220, 0.13), transparent 24%),
        rgba(2, 6, 23, 0.95);
    border-color: rgba(148, 163, 184, 0.12);
}

.dark-theme .app-sidebar-toggle {
    background: rgba(2, 6, 23, 0.94);
    color: #f8fafc;
}

@media (max-width: 1080px) {
    .app-layout {
        grid-template-columns: 1fr;
        width: min(1180px, calc(100% - 18px));
        margin-top: 12px;
    }

    .app-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        position: sticky;
        top: 94px;
        z-index: 131;
    }

    .app-sidebar {
        position: fixed;
        left: 12px;
        top: 12px;
        bottom: 12px;
        width: min(340px, calc(100vw - 24px));
        min-height: auto;
        z-index: 140;
        transform: translateX(-110%);
        transition: transform 0.24s ease;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-layout > .app-main {
        min-width: 0;
    }
}
