﻿/* Navigation Action Buttons (Login/Projects) */
.nav-projects-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 42px;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 24px;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
}

.nav-projects-btn:hover {
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.7);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    border-color: #3b82f6;
}

/* Stable Action Button (Generator) */
.action-btn {
    height: 48px;
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 8px;
    cursor: pointer;
}

/* Sidebar Specific Buttons */
.sidebar-btn {
    height: 40px;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 12px;
}

/* High-End Animated Buy Credits Button */
.btn-buy-credits {
    position: relative;
    height: 42px;
    min-width: 156px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #7928CA, #FF0080, #0070F3, #7928CA);
    background-size: 400% 400%;
    color: white !important;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px -10px rgba(121, 40, 202, 0.5);
    animation: gradientFlow 15s ease infinite;
    z-index: 10;
}

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

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

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

.btn-buy-credits::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: skewX(-20deg);
    animation: simpleShimmer 6s infinite;
}

@keyframes simpleShimmer {
    0% {
        left: -150%;
    }

    20% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

.btn-buy-credits:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(255, 0, 128, 0.8);
    animation-duration: 4s;
}

.btn-buy-credits:active {
    transform: scale(0.98);
}

/* Layout Consistency */
.generator-container {
    width: 100%;
    max-width: 896px;
    margin-left: auto;
    margin-right: auto;
}

/* Sidebar Transitions */
#sidebar {
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.active {
    transform: translateX(0);
}

.sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
    z-index: 140;
    transition: opacity 0.3s ease;
}

button,
.btn {
    flex-shrink: 0 !important;
}

/* Markdown & Prose Styling */
.prose {
    line-height: 1.6;
    color: #d1d5db;
    /* gray-300 */
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose pre {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.prose code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.prose pre code {
    background: transparent;
    padding: 0;
}

.prose ul,
.prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose h1,
.prose h2,
.prose h3 {
    font-family: 'Orbitron', sans-serif;
    color: white;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.prose h1 {
    font-size: 1.25rem;
}

.prose h2 {
    font-size: 1.1rem;
}

.prose h3 {
    font-size: 1rem;
}

.prose strong {
    color: white;
    font-weight: 600;
}

#generateBtn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.5);
    filter: brightness(1.2);
}

#generateBtn:active {
    transform: scale(0.95);
}

/* Smooth Scroll for Output */
#genOutputBox {
    scroll-behavior: smooth;
}

/* Project Menu Styling */
.project-card {
    position: relative !important;
}

.project-menu-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #52525b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    z-index: 20;
}

.project-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.project-menu-btn:active {
    transform: scale(0.95);
}

.project-dropdown {
    position: absolute;
    top: 45px;
    right: 12px;
    width: 140px;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 50;
    display: none;
    flex-direction: column;
}

.project-dropdown.active {
    display: flex;
    animation: dropdownFade 0.2s ease-out;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

.project-dropdown button {
    width: 100%;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Orbitron', sans-serif;
    color: #d1d5db;
    text-align: left;
    transition: all 0.2s;
    background: transparent;
    border: none !important;
    cursor: pointer;
    text-transform: uppercase;
}

.project-dropdown button:hover {
    background: #27272a;
    color: white;
}

.project-dropdown button.delete-opt {
    color: #ef4444;
    border-top: 1px solid #27272a !important;
}

.project-dropdown button.delete-opt:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Chat Mode Chips */
.mode-chip {
    padding: 8px 14px;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #52525b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.mode-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
    border-color: rgba(255, 255, 255, 0.2);
}

.mode-chip.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Game specific active colors */
.game-roblox .mode-chip.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.game-fortnite .mode-chip.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* Copy Button Styling */
.code-wrapper {
    position: relative;
    margin: 1.5rem 0;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #a1a1aa;
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.copy-btn.copied {
    border-color: #22c55e;
    color: #22c55e;
}

/* Tutorial & Showcase Utilities */
.glass-card {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2rem;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 1rem;
}

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

.showcase-card {
    border-radius: 20px;
    overflow: hidden;
    background: #09090b;
    border: 1px solid #18181b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.showcase-card:hover {
    transform: translateY(-8px);
    border-color: #3b82f6;
    box-shadow: 0 20px 40px -20px rgba(59, 130, 246, 0.3);
}

.showcase-img {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s;
}

.showcase-card:hover .showcase-img {
    transform: scale(1.05);
}

/* Nav Tutorial Button */
.btn-nav-tutorial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    min-width: 140px;
    padding: 0 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.btn-nav-tutorial:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    color: white;
}

.btn-nav-tutorial svg {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.btn-nav-tutorial:hover svg {
    transform: rotate(-10deg) scale(1.1);
}


@media (max-width: 768px) {
    .btn-nav-tutorial {
        padding: 8px;
    }

    .btn-nav-tutorial span {
        display: none;
    }

    .btn-nav-tutorial svg {
        margin-right: 0;
    }
}

/* Auth Loader Spinner */
.auth-spinner {
    border-right-color: transparent !important;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- GLOBAL MOBILE IMPROVEMENTS --- */
@media (max-width: 640px) {
    .nav-projects-btn {
        min-width: 100px;
        padding: 0 12px;
        font-size: 10px;
        letter-spacing: 0.05em;
    }

    .btn-buy-credits {
        min-width: 100px;
        padding: 0 12px;
        font-size: 10px;
        letter-spacing: 0.05em;
    }

    .btn-nav-tutorial {
        min-width: 42px;
        padding: 0;
        aspect-ratio: 1;
    }

    #sidebar {
        width: 100% !important;
        max-width: 100%;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .prose pre {
        padding: 0.75rem;
        margin: 1rem 0;
    }

    .prose pre code {
        font-size: 0.75rem;
    }

    .mode-chip {
        padding: 10px 16px;
        font-size: 11px;
    }

    .chat-container {
        min-height: 300px !important;
        height: calc(100dvh - 180px) !important;
    }

    /* System Terminal Mobile Refinement */
    #system-terminal {
        height: 28px !important;
        padding: 4px 10px !important;
        font-size: 8px !important;
    }

    header {
        padding-top: 36px !important;
        /* Adjust for terminal height */
    }

    nav.fixed.top-12 {
        top: 28px !important;
        /* Align with new terminal height */
    }

    /* Mobile Modal Improvements */
    .modal-content {
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #payment-selection-modal.flex .modal-content,
    #signup-modal.flex .modal-content,
    #platform-selection-modal.flex .modal-content {
        transform: translateY(0);
    }

    /* Sticky Bottom Nav for Mobile */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 10px 0;
        z-index: 100;
        justify-content: space-around;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: #71717a;
        text-decoration: none;
        font-family: 'Orbitron', sans-serif;
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .mobile-nav-item.active {
        color: #3b82f6;
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }

    /* Hide redundant elements on mobile header */
    .mobile-hide {
        display: none !important;
    }
}

/* Fix for mobile keyboard pushing up content */
@supports (-webkit-touch-callout: none) {
    .chat-container {
        height: -webkit-fill-available;
    }
}

/* Version Badge */
.v1-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 9999px;
    color: #3b82f6;
    font-size: 10px;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.1em;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.v1-badge:hover {
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Toast Notification */
#mb-toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mb-toast {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    pointer-events: auto;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.mb-toast-out {
    animation: toast-out 0.4s ease-in forwards;
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}