:root {
    /* Core Colors */
    --bg-color: #0d0d0d;
    --sidebar-bg: #34343436;
    --card-bg: #212121;
    --input-bg: #2f2f2f;

    /* Brand Colors */
    --brand-purple: 76, 29, 149;
    --brand-blue: 56, 189, 248;

    /* Text */
    --text-primary: #ececec;
    --text-secondary: #b4b4b4;

    /* Accents */
    --accent-color: rgb(var(--brand-blue));
    --accent-hover: rgb(var(--brand-purple));

    --border-color: #333333;
    --user-msg-bg: #2f2f2f;
    --hover-bg: #2a2a2a;
    --danger-color: #ff4d4d;

    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition-fast: 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

.cursor-pointer {
    cursor: pointer;
}


html {
    scroll-behavior: smooth;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    /* Remove height 100% and overflow:auto to let html handle scroll */
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: #1d1d1d;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: .2rem;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    /* Prevent flex squashing */
}

@media (min-width: 769px) {
    .sidebar {
        background-color: var(--sidebar-bg);
    }
}

.sidebar.hidden {
    margin-left: -260px;
    display: flex !important;
    /* Override global .hidden utility to allow animation */
    /* Removed width/padding changes to prevent layout thrashing inside sidebar */
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-chat-btn {
    flex-grow: 1;
    /* Take remaining space */
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.temp-chat-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 38px;
    /* Match new chat btn height approx */
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.temp-chat-btn:hover,
.temp-chat-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.sidebar-toggle {
    color: var(--text-secondary);
}

.new-chat-btn:hover {
    background-color: var(--hover-bg);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.chat-list-container {
    flex-grow: 1;
    overflow-y: auto;
    /* Hide scrollbar */
    scrollbar-width: none;
}

.chat-list-container::-webkit-scrollbar {
    display: none;
}

.section-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 10px 0 4px 10px;
    /* Reduced margin */
    font-weight: 500;
}

.chat-list {
    list-style: none;
}

.chat-item {
    padding: 3px 10px;
    /* Reduced vertical padding */
    margin-bottom: 1px;
    /* Reduced gap */
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    transition: var(--transition-fast);
    position: relative;
    /* overflow: hidden; -- Removed to allow popover to show */
    white-space: nowrap;
}

.chat-item:hover {
    background-color: var(--hover-bg);
}

.chat-item.active {
    background-color: var(--card-bg);
}

.chat-title {
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    font-size: 14px;
}

.chat-title-input {
    flex-grow: 1;
    background: var(--input-bg);
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-main);
    padding: 2px 5px;
    border-radius: 4px;
    outline: none;
    width: 100%;
    /* Ensure it takes space */
}

.chat-options-btn {
    opacity: 0;
    transition: var(--transition-fast);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.chat-item:hover .chat-options-btn {
    opacity: 1;
}

/* Chat Item Menu Popover */
.chat-menu-popover {
    position: absolute;
    top: 15px;
    /* Below the item */
    right: 10px;
    /* Aligned to right */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    min-width: 140px;
    /* Slightly wider for Rename */
    display: none;
}

.chat-menu-popover.visible {
    display: block;
}

.menu-item {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.menu-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.menu-item.delete {
    color: var(--danger-color);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 10px;
    /* Prevent shrinking */
    min-width: 228px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    background: linear-gradient(45deg, #1c1b1b, transparent);
}

.user-profile:hover {
    background-color: var(--hover-bg);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 14px;
    font-weight: 500;
}

.user-info .plan {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- MAIN CONTENT --- */
/* --- MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    /* Ensure full width on mobile when sidebar is absolute */
}

.sidebar-show-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    /* Moved right */
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-10px);
}

/* Scroll Animation Classes */
.section-heading,
.about-img-graphic,
.about-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Stagger Delays are handled in JS now for reliability */

/* About Section */
/* Show hamburger only when sidebar is hidden */
.sidebar.hidden+.main-content .sidebar-show-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.top-bar {
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.model-selector-container {
    position: relative;
    margin-left: 0;
    transition: margin-left 0.2s;
}

/* When sidebar hidden (and ham button visible), add space for it on desktop/mobile? 
   Actually on mobile the button is top-left. On desktop too.
   So we should push the content or margin if the button is there to avoid overlap?
   The button is absolute top:15. The top-bar is flex.
   Let's add left margin to top-bar content if button is visible?
   Or just ensure button doesn't overlap text.
*/
.sidebar.hidden+.main-content .model-selector-container {
    margin-left: 30px;
    /* Space for hamburger */
}

/* Ideally center this if no sidebar toggle obscures it */
@media(min-width: 768px) {
    /* Desktop specific refinements if needed */
}

select {
    color: var(--bg-color);
}

option {
    color: var(--bg-color);
}

iframe {
    border: none;
    width: 100%;
    height: 100vh;
}

.model-selector {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.model-selector:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.model-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px 4px 0px 4px;
    width: 280px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    margin-top: 2px;
    z-index: 100;
}

.model-dropdown.hidden {
    display: none;
}

.model-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 8px;
    /* More compact */
    margin-bottom: 4px;
    /* Separation */
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.model-option:hover {
    background-color: var(--hover-bg);
}

.model-option.selected {
    background-color: #2a2a2a;
}

.model-option .checkmark {
    margin-left: auto;
    color: var(--accent-color);
    opacity: 0;
}

.model-option.selected .checkmark {
    opacity: 1;
}

.model-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.model-details {
    display: flex;
    flex-direction: column;
}

.model-details .name {
    font-size: 14px;
    font-weight: 500;
}

.model-details .desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Temp Slider */
.temp-control-container {
    padding: 12px 8px 8px 8px;
    border-top: 1px solid var(--border-color);
    margin-top: 5px;
}

.temp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.temp-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.temp-value {
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-weight: 500;
}

.temp-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.temp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: transform 0.1s;
}

.temp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- CHAT AREA --- */
.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-primary);
    opacity: 0.8;
}

.empty-state .logo-placeholder {
    font-size: 48px;
    margin-bottom: 20px;
    background: var(--card-bg);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Messages */
.message {
    display: flex;
    gap: 16px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background-color: var(--user-msg-bg);
    padding: 10px 16px;
    border-radius: 20px;
    border-top-right-radius: 4px;
    /* Distinct styling */
    max-width: 80%;
    font-size: 15px;
}

.ai-message {
    justify-content: flex-start;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    /* Fallback */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.content-col {
    flex-grow: 1;
    max-width: 90%;
}

.model-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.msg-text {
    line-height: 1.6;
}

/* Tool Logs */
.tools-section {
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 13px;
    background: rgba(255, 255, 255, 0.02);
}

.tools-header {
    display: flex;
    font-size: 0.7rem;
    align-items: center;
    justify-content: space-between;
    padding: 3px 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    user-select: none;
    transition: background 0.2s;
}

.tools-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.th-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.tools-header .toggle-icon {
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.tools-section.collapsed .tools-list {
    display: none;
}

.tools-section.collapsed .tools-header .toggle-icon {
    transform: rotate(-90deg);
}

.tools-list {
    padding: 0;
    border-top: 1px solid var(--border-color);
}

.tool-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-item:last-child {
    border-bottom: none;
}

.tool-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
}

.tool-name-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-spinner {
    color: var(--accent-color);
    animation: spin 1s linear infinite;
}

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

.tool-result-toggle {
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
}

.tool-result {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgb(91 91 91 / 26%);
    padding: 8px;
    border-radius: 4px;
    margin-top: 4px;
    white-space: pre-wrap;
    display: none;
    /* Hidden by default per req 2? Or toggleable */
}

.tool-result.visible {
    display: block;
}

/* Thinking Process */
.thinking-process {
    background-color: var(--card-bg);
    border-left: 3px solid var(--text-secondary);
    border-radius: 4px;
    margin-bottom: 5px;
    overflow: hidden;
}

.thinking-header {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.thinking-header .fa-chevron-down {
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.thinking-content {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: pre-wrap;
    display: none;
    /* Collapsed by default */
}

.thinking-process.expanded .thinking-content {
    display: block;
}

.thinking-process.expanded .thinking-header .fa-chevron-down {
    transform: rotate(180deg);
}

/* Message Actions */
.message-actions {
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}

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

/* --- INPUT AREA --- */
.input-container-wrapper {
    padding: 0 20px 20px;
    display: flex;
    justify-content: center;
    background: transparent;
}

.input-container {
    width: 100%;
    max-width: 800px;
    background-color: var(--input-bg);
    border-radius: 24px;
    padding: 10px 16px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
}

.file-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
}

.file-pill {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    /* If wrap */
}

.file-pill .remove-file {
    cursor: pointer;
    color: var(--text-secondary);
}

.file-pill .remove-file:hover {
    color: var(--danger-color);
}

.input-box {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    resize: none;
    max-height: 200px;
    padding: 8px 0;
    outline: none;
    font-size: 15px;
}

.attach-btn,
.send-btn,
.stop-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    height: 36px;
    width: 36px;
}

.attach-btn:hover {
    background-color: var(--hover-bg);
}

.send-btn {
    background-color: var(--text-primary);
    color: var(--bg-color);
    border-radius: 50%;
}

.send-btn:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
}

.stop-btn {
    background-color: var(--text-primary);
    color: var(--bg-color);
    border-radius: 50%;
}

.stop-btn.hidden {
    display: none;
}

.input-footer {
    text-align: center;
    padding-top: 8px;
}

.status-text {
    font-size: 11px;
    color: #666;
}

/* Edit Mode styling */
.editing-textarea {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-primary);
    margin: 5px 0;
}

.edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 5px;
}

.save-edit-btn,
.cancel-edit-btn {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
}

.save-edit-btn {
    background: var(--accent-color);
    color: black;
    border: none;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        height: 100%;
        width: 260px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    /* When hidden on mobile, it goes off screen. */
    .sidebar.hidden {
        transform: translateX(-100%);
        width: 260px;
        /* Keep width so transition works smoothly */
        margin-right: 0;
        opacity: 0;
        pointer-events: none;
    }

    /* Main content always full width on mobile */
    .main-content {
        width: 100%;
    }
}

/* --- MINIMIZED BUBBLE MODE --- */

/* Launcher Button (Bottom Right) */
.chat-launcher {
    position: fixed;
    bottom: -4px;
    right: -4px;
    width: 40px;
    height: 40px;
    border-radius: 0.7rem 0 0 0;
    background: linear-gradient(135deg, var(--accent-color), #e0e0e0);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    font-size: 24px;
    color: #000;
}

.chat-launcher:hover {
    transform: scale(1.1);
}

.chat-launcher.hidden {
    transform: scale(0) rotate(180deg);
    opacity: 0;
    pointer-events: none;
}

/* App Container Transitions (The Genie Effect) */
.app-container {
    transition:
        transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 0.5s ease,
        border-radius 0.5s ease;
    transform-origin: bottom right;
    position: fixed;
    /* Fix to screen */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    overflow: hidden;
    background-color: #0d0d0d66;
    backdrop-filter: blur(15px);
}

/* Minimized State */
.app-container.minimized {
    position: fixed;
    /* Remove from flow */
    top: 0;
    left: 0;
    transform: translate(calc(50vw - 30px), calc(50vh - 30px)) scale(0);
    opacity: 0;
    pointer-events: none;
    border-radius: 50%;
    z-index: -1;
    /* Ensure it is behind everything */
}

/* Specific fix: ensure transform origin is correct for bottom right */
.app-container {
    transform-origin: bottom right;
}

/* Improve animation quality */
.app-container {
    will-change: transform, opacity, border-radius;
}

/* Markdown Code Blocks */
.msg-text pre {
    border-radius: 1rem;
    background: #212223 !important;
    padding: .3rem;
    margin: 10px 0;
    overflow-x: auto;
}

.msg-text code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    border-radius: 0.7rem;
}

/* Inline code only */
.msg-text :not(pre)>code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

/* --- LANDING PAGE HERO --- */
.landing-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.6s ease;
}

.landing-hero.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

.hero-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(13, 13, 13, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.login-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 2;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    background: var(--text-primary);
    /* color: var(--bg-color); */
    /* Para login */
    color: var(--text-primary);
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.hero-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(56, 189, 248, 0.1), transparent 25%);
    z-index: 1;
    pointer-events: none;
}

/* Scrollable Landing Hero */
.landing-hero {
    position: relative !important;
    height: 100vh !important;
    /* Fixed to viewport */
    min-height: 100vh;
    padding-bottom: 0;
    /* Remove padding as we center content */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Vertically center */
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Sections Common */
section:not(.landing-hero),
.site-footer {
    height: 100vh;
    min-height: 100vh;
    padding: 20px;
    /* Reduces padding to fit content better */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-heading {
    font-size: 42px;
    /* Increased from 32px */
    text-align: center;
    margin-bottom: 30px;
    /* Reduced to save space */
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 30%, rgb(var(--brand-blue)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-bottom: 20px;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, rgb(var(--brand-blue)) 0%, rgb(var(--brand-purple)) 100%);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(var(--brand-blue), 0.5);
}

/* Features Section */
.features-section {
    background-color: #111;
}

.features-section .container {
    max-width: 95vw;
    /* Use almost full width */
    padding: 0 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    /* Increased gap for better spacing */
    width: 100%;
}

/* Consolidated Feature Card Styles */
/* Keyframe Animation for robust entry */
@keyframes robustFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.feature-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    /* Initial State hidden */
    opacity: 0;
    /* No transition here for entry, we use animation */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Only hover effects */
}

.feature-card.visible {
    /* Trigger Animation */
    animation: robustFadeInUp 0.6s ease-out forwards;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: linear-gradient(145deg, var(--card-bg), #2a2a2a);
}

.feature-icon {
    font-size: 24px;
    /* Reduced from 36px */
    color: var(--accent-color);
    margin-bottom: 16px;
    /* Reduced from 24px */
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    /* Reduced from 70px */
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    /* Soft square looks more modern */
}

.feature-card h3 {
    font-size: 18px;
    /* Slightly smaller */
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.3;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 14px;
    margin: 0;
}

/* About Section */
.about-section {
    background-color: #0d0d0d;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
}

.about-text .section-heading {
    margin-bottom: 30px;
}

.about-text p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 16px;
    margin-bottom: 20px;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.about-img-graphic {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--brand-purple), 0.3);
    transition: transform 0.3s ease;
}

.about-img-graphic:hover {
    transform: scale(1.02);
    box-shadow: 0 30px 60px rgba(var(--brand-blue), 0.2);
}

@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
    }

    .about-text .section-heading {
        text-align: center;
    }
}

/* Footer */
.site-footer {
    background-color: #050505;
    padding: 80px 20px 20px;
    border-top: 1px solid #1a1a1a;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-col h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 24px;
}

.footer-col p,
.footer-col ul li a {
    color: #888;
    line-height: 1.6;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #1a1a1a;
    color: #555;
    font-size: 12px;
}

/* --- HERO ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-content {
    animation: fadeInUp 1s ease-out forwards;
}

.hero-title {
    animation: fadeInUp 1s ease-out 0.2s forwards;
    opacity: 0;
    /* Starr hidden for delay */
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s forwards;
    opacity: 0;
}

/* Add a floating/pulse effect to the background overlay or elements */


/* Dynamic Background Effect */
.landing-hero {
    background: radial-gradient(circle at top right, #1a1a1a, #000000);
}

.hero-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: none;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* Purple Circle */
.hero-background-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(var(--brand-purple), 0.2) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: moveCircle1 20s infinite alternate ease-in-out;
    filter: blur(40px);
}

/* Blue Circle */
.hero-background-overlay::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 85%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(var(--brand-blue), 0.16) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: moveCircle2 25s infinite alternate ease-in-out;
    filter: blur(40px);
}

@keyframes moveCircle1 {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-40%, -60%) scale(1.1);
    }

    100% {
        transform: translate(-60%, -40%) scale(0.9);
    }
}

@keyframes moveCircle2 {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-60%, -40%) scale(1.1);
    }

    100% {
        transform: translate(-40%, -60%) scale(1.2);
    }
}

/* --- BRAND ACCENTS --- */

.feature-icon {
    color: rgb(var(--brand-blue));
    background: rgba(var(--brand-blue), 0.1);
    border: 1px solid rgba(var(--brand-blue), 0.2);
}

.feature-card:hover .feature-icon {
    background: rgb(var(--brand-blue));
    color: #fff;
    box-shadow: 0 0 20px rgba(var(--brand-blue), 0.4);
}

.feature-card:hover {
    border-color: rgba(var(--brand-purple), 0.3);
}

.login-btn::after {
    /* Subtle glow on hover */
    background: radial-gradient(circle, rgba(var(--brand-purple), 0.4) 0%, transparent 70%);
}

.cta-btn {
    /* If re-added later, use gradient */
    background: linear-gradient(90deg, rgb(var(--brand-blue)) 0%, rgb(var(--brand-purple)) 100%);
}

/* Links */
a {
    color: rgb(var(--brand-blue));
}

a:hover {
    color: rgb(var(--brand-purple));
}

/* Hero Logo */
.hero-logo {
    max-width: 150px;
    height: auto;
    margin: 24px auto;
    display: block;
    animation: fadeInUp 1s ease-out 0.3s forwards;
    opacity: 0;
    filter: drop-shadow(0 0 20px rgba(var(--brand-blue), 0.3));
}

/* --- MOBILE OPTIMIZATION --- */
/* Utility Classes for Responsiveness */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Mobile Menu Overlay Styles */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(13, 13, 13, 0.98);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.hamburger-btn,
.close-menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

.close-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

.mobile-link {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.mobile-link:hover {
    color: var(--accent-color);
}

.mobile-login {
    margin-top: 20px;
    font-size: 18px;
    padding: 12px 30px;
}

@media (max-width: 768px) {

    /* Toggle Visibility */
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    /* Disable Scroll Snap */
    html {
        scroll-snap-type: none;
        height: auto;
        overflow-y: auto;
    }

    body {
        height: auto;
        overflow: auto;
    }

    /* Allow sections to flow naturally */
    section:not(.landing-hero),
    .site-footer {
        height: auto !important;
        min-height: auto !important;
        scroll-snap-align: none;
        padding: 60px 20px !important;
        display: block;
    }

    /* Hero specific */
    .landing-hero {
        min-height: 100vh !important;
        /* Force full screen on mobile */
        height: auto !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-top: 80px !important;
        padding-bottom: 40px !important;
    }

    .hero-title {
        font-size: 40px;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 16px;
        padding: 0 10px;
    }

    /* Nav adjustments */
    .hero-nav {
        padding: 15px 20px;
        /* Keep it row for logo + hamburger */
        justify-content: space-between;
        align-items: center;
        background: rgba(13, 13, 13, 0.8);
        /* Slightly more transparent */
    }

    .nav-logo {
        margin-bottom: 0;
        font-size: 20px;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* About Section */
    .about-content {
        flex-direction: column;
        gap: 40px;
    }

    .about-img-graphic {
        margin-top: 0;
    }
}

/* --- GENERIC MODAL SYSTEM --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    padding: 30px;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-container.modal-full-view {
    width: 90vw !important;
    max-width: 90vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
}

.modal-container.modal-full-view .modal-body {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    padding: 0;
}

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

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

.modal-close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-header {
    margin-bottom: 15px;
    text-align: center;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #fff 0%, rgb(var(--brand-blue)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-body {
    margin-bottom: 0;
}

/* Auth Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-group label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.input-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    padding: 12px 12px 12px 40px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(var(--brand-blue), 0.1);
}

.full-width {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* Utility to lock scroll */
/* Utility to lock scroll */
html.no-scroll,
body.no-scroll {
    overflow: hidden !important;
    /* height removed to preserve scroll position */
}

/* Ensure modal handles internal scrolling if needed */
.modal-overlay {
    overflow-y: auto;
    /* Allow scrolling within the overlay */
}

.modal-container {
    max-height: 90vh;
    overflow-y: auto;
    /* Allow scrolling within the container if content is huge */
}

/* --- NOTIFICATION SYSTEM --- */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 350px;
    width: 90%;
    pointer-events: none;
    /* Let clicks pass through empty areas */
}

.notification-toast {
    align-items: center;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-content p {
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.5;
    color: inherit;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: auto;
    padding: 2px;
    font-size: 16px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Variants */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-success .toast-progress {
    background: #10b981;
}

.toast-error {
    border-left: 4px solid rgb(var(--danger-color));
    /* Using variable inside rgb won't work if var is hex. Check vars. */
}

.toast-error .toast-icon {
    color: var(--danger-color);
}

.toast-error .toast-progress {
    background: var(--danger-color);
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-warning .toast-progress {
    background: #f59e0b;
}

.toast-info {
    border-left: 4px solid rgb(var(--brand-blue));
}

.toast-info .toast-icon {
    color: rgb(var(--brand-blue));
}

.toast-info .toast-progress {

    background: rgb(var(--brand-blue));
}

/* Premium Title */
.page-title-premium {
    font-size: 15px;
    text-align: left;
    /* Kept left for dashboard alignment, user had center but context implies left */
    margin-bottom: 5px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, rgb(var(--brand-blue)) 0%, #fff 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-top: 8px;
    padding-left: 10px;
    display: inline-block;
}

.page-title-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, rgb(var(--brand-blue)) 0%, rgb(var(--brand-purple)) 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(var(--brand-blue), 0.5);
}

/* Premium Title */
.page-main-title-premium {
    font-size: 15px;
    text-align: left;
    /* Kept left for dashboard alignment, user had center but context implies left */
    margin-bottom: 5px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, rgb(var(--brand-blue)) 0%, #7e63bd 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-top: 5px;
    padding-left: 10px;
    display: inline-block;
}

.page-main-title-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 115%;
    height: 4px;
    background: linear-gradient(90deg, rgb(7 96 136) 0%, rgb(191 56 248) 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(var(--brand-blue), 0.5);
}