/* ============================================================
   PromptGen — style.css
   Custom CSS loaded on top of Bootstrap 5.
   Theme: Dark, Purple/Blue gradient, Premium UI.
============================================================ */


/* ============================================================
   1. CSS VARIABLES (Design Tokens)
   All colors and values defined once here.
   Change a variable → changes everywhere.
============================================================ */
:root {
    /* Background colors */
    --bg-body:         #09090f;
    --bg-card:         rgba(255, 255, 255, 0.04);
    --bg-card-hover:   rgba(255, 255, 255, 0.07);

    /* Accent colors */
    --purple:          #7c3aed;
    --blue:            #3b82f6;
    --purple-soft:     rgba(124, 58, 237, 0.15);
    --purple-border:   rgba(124, 58, 237, 0.35);
    --purple-glow:     rgba(124, 58, 237, 0.25);
    --purple-light:    #a78bfa;

    /* Text */
    --text-primary:    #f1f5f9;
    --text-muted:      #64748b;
    --text-subtle:     #94a3b8;

    /* Borders */
    --border:          rgba(255, 255, 255, 0.08);

    /* Gradients */
    --gradient-bg:     linear-gradient(135deg, #09090f 0%, #0d0d1f 50%, #130920 100%);
    --gradient-accent: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    --gradient-card:   linear-gradient(135deg, rgba(124,58,237,0.08), rgba(59,130,246,0.04));

    /* Shadows */
    --shadow-glow:     0 0 60px rgba(124, 58, 237, 0.12);
    --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.4);

    /* Border radius */
    --radius-card:     18px;
    --radius-btn:      10px;
    --radius-sm:       8px;
}


/* ============================================================
   2. BASE STYLES
============================================================ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Custom scrollbar (Chrome, Edge) */
::-webkit-scrollbar         { width: 6px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

/* Firefox scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--purple) transparent; }


/* ============================================================
   3. NAVBAR
============================================================ */
#mainNavbar {
    background: rgba(9, 9, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 0;
    transition: background 0.3s ease;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary) !important;
}

.nav-link {
    color: var(--text-subtle) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card-hover);
}

.nav-link.active {
    color: var(--purple-light) !important;
    background: var(--purple-soft);
}


/* ============================================================
   4. HERO SECTION
============================================================ */
.hero-section {
    padding: 5rem 0 2.5rem;
}

/* Small pill label above title */
.badge-pill {
    display: inline-block;
    background: var(--purple-soft);
    border: 1px solid var(--purple-border);
    color: var(--purple-light);
    padding: 0.4rem 1.1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    box-shadow: 0 0 20px var(--purple-glow);
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--text-primary);
    margin: 1.2rem 0;
}

/* Purple → Blue gradient text */
.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-subtle);
    max-width: 500px;
    line-height: 1.75;
}

/* Stats row below subtitle */
.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.7rem 2rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--purple-light);
    line-height: 1;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}


/* ============================================================
   5. GENERATOR CARD
============================================================ */
.generator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    transition: box-shadow 0.3s ease;
}

.generator-card:hover {
    box-shadow: 0 0 80px var(--purple-glow), var(--shadow-card);
}

/* Label with step number circle */
.form-label-custom {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--gradient-accent);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}


/* ============================================================
   6. TEXTAREA INPUT
============================================================ */
.input-dark {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 1rem !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-dark:focus {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important;
    outline: none !important;
}

.input-dark::placeholder {
    color: var(--text-muted);
    font-size: 0.88rem;
}


/* ============================================================
   7. CATEGORY GRID
============================================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 576px) {
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Each category is a clickable radio card */
.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 0.5rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

/* Hide the actual radio button (we use the label for styling) */
.category-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cat-icon {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.cat-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-subtle);
    display: block;
    transition: color 0.2s ease;
}

.cat-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    line-height: 1.3;
}

/* Hover state */
.category-option:hover {
    background: var(--purple-soft);
    border-color: var(--purple-border);
    transform: translateY(-2px);
}

.category-option:hover .cat-icon,
.category-option:hover .cat-name {
    color: var(--purple-light);
}

/* Selected state */
.category-option.selected {
    background: var(--purple-soft);
    border-color: var(--purple);
    box-shadow: 0 0 20px var(--purple-glow);
}

.category-option.selected .cat-icon,
.category-option.selected .cat-name {
    color: var(--purple-light);
}


/* ============================================================
   8. GENERATE BUTTON
============================================================ */
.btn-generate {
    background: var(--gradient-accent);
    color: white !important;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: var(--radius-btn);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Shimmer animation on hover */
.btn-generate::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.45s ease;
}

.btn-generate:hover::after { left: 100%; }

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(124, 58, 237, 0.5);
}

.btn-generate:disabled {
    opacity: 0.7;
    transform: none;
    cursor: not-allowed;
}


/* ============================================================
   9. OUTPUT CARD
============================================================ */
.output-card {
    background: linear-gradient(135deg, rgba(124,58,237,0.07), rgba(59,130,246,0.04));
    border: 1px solid var(--purple-border);
    border-radius: var(--radius-card);
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.12);
    animation: fadeSlideUp 0.5s ease both;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* The prompt text box */
.prompt-text {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.85;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Inter', sans-serif;
}


/* ============================================================
   10. COPY BUTTON
============================================================ */
.btn-copy {
    background: var(--purple-soft);
    border: 1px solid var(--purple-border);
    color: var(--purple-light);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(124, 58, 237, 0.28);
    border-color: var(--purple);
    color: white;
    transform: translateY(-1px);
}


/* ============================================================
   11. DELETE BUTTON
============================================================ */
.btn-delete {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.5);
    color: white;
}


/* ============================================================
   12. CATEGORY BADGE
============================================================ */
.category-badge {
    display: inline-block;
    background: var(--purple-soft);
    border: 1px solid var(--purple-border);
    color: var(--purple-light);
    padding: 0.18rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}


/* ============================================================
   13. RECENT HISTORY CARDS (Home Page)
============================================================ */
.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.22s ease;
}

.history-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--purple-border);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
}

.prompt-preview {
    font-size: 0.82rem;
    color: var(--text-subtle);
    line-height: 1.5;
}

/* "View All" link next to "Recent Prompts" heading */
.btn-view-all {
    color: var(--purple-light);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--purple-border);
    background: var(--purple-soft);
    transition: all 0.2s ease;
}

.btn-view-all:hover {
    background: rgba(124, 58, 237, 0.25);
    color: white;
}


/* ============================================================
   14. FULL HISTORY CARDS (History Page)
============================================================ */
.history-card-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    transition: all 0.22s ease;
    animation: fadeSlideUp 0.4s ease both;
}

.history-card-full:hover {
    background: var(--bg-card-hover);
    border-color: var(--purple-border);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.1);
}

/* Scrollable prompt text in history cards */
.prompt-text-history {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: #e2e8f0;
    font-size: 0.88rem;
    line-height: 1.75;
    max-height: 160px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}


/* ============================================================
   15. FILTER BAR (History Page)
============================================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-subtle);
    padding: 0.38rem 1rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--purple-soft);
    border-color: var(--purple-border);
    color: var(--purple-light);
}


/* ============================================================
   16. TOAST NOTIFICATION
============================================================ */
#copyToast {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.3);
    backdrop-filter: blur(12px);
    color: var(--text-primary);
    border-radius: 10px;
    min-width: 220px;
}


/* ============================================================
   17. FOOTER
============================================================ */
.footer {
    border-top: 1px solid var(--border);
    background: rgba(9, 9, 15, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-subtle);
    font-size: 0.88rem;
}

.badge-coming-soon {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 4px;
}


/* ============================================================
   18. EMPTY STATE (History Page)
============================================================ */
.empty-state {
    padding: 5rem 0;
}

.empty-state .display-1 {
    opacity: 0.3;
}


/* ============================================================
   19. RESPONSIVE TWEAKS
============================================================ */
@media (max-width: 768px) {
    .hero-section { padding: 3rem 0 1.5rem; }
    .hero-stats   { flex-wrap: wrap; gap: 1rem; padding: 0.7rem 1.2rem; }
    .generator-card { padding: 1.5rem !important; }
}


/* ============================================================
   20. THEME TOGGLER STYLES [NEW]
============================================================ */
.btn-theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-theme-toggle:hover {
    background: var(--bg-card-hover);
    transform: rotate(15deg) scale(1.05);
    border-color: var(--purple-border);
}

.theme-icon-dark {
    color: #fbbf24; /* Warm yellow moon stars */
}

.theme-icon-light {
    color: #ea580c; /* Orange sun */
}


/* ============================================================
   21. AUTHENTICATION PAGES STYLING [NEW]
============================================================ */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    animation: fadeSlideUp 0.5s ease both;
}

.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: var(--purple-soft);
    border: 1px solid var(--purple-border);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--purple-glow);
}

.navbar-user-badge {
    display: inline-flex;
    align-items: center;
    background: var(--purple-soft);
    border: 1px solid var(--purple-border);
    color: var(--purple-light);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
}

.btn-register-nav {
    border: 1px solid var(--purple-border);
    background: var(--purple-soft);
    color: var(--purple-light) !important;
}

.btn-register-nav:hover {
    background: var(--purple);
    color: white !important;
}

.text-danger-hover:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}


/* ============================================================
   22. FAVORITES BUTTON & CONTROLS STYLES [NEW]
============================================================ */
.btn-fav-star {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.65rem;
    transition: all 0.2s ease;
}

.btn-fav-star:hover {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
}

.btn-fav-star.active {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
}

.btn-fav-active {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.5) !important;
    color: #fbbf24 !important;
}


/* ============================================================
   23. TRANSITION DECLARATIONS FOR BODY & ELEMENTS [NEW]
============================================================ */
body, 
#mainNavbar, 
.nav-link,
.generator-card, 
.history-card, 
.history-card-full, 
.auth-card,
.prompt-text, 
.prompt-text-history, 
.input-dark,
.category-option, 
.btn-generate, 
.btn-copy, 
.btn-delete, 
.btn-theme-toggle,
.navbar-brand,
footer,
h1, h2, h3, h4, h5, p, span, small {
    transition: background 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}


/* ============================================================
   24. LIGHT MODE STYLES & VARIABLE OVERRIDES [NEW]
============================================================ */
:root.light-mode {
    --bg-body:         #f8fafc;
    --bg-card:         #ffffff;
    --bg-card-hover:   #f1f5f9;
    
    /* Text */
    --text-primary:    #0f172a;
    --text-subtle:     #334155;
    --text-muted:      #64748b;
    
    /* Borders */
    --border:          #e2e8f0;
    
    /* Gradients */
    --gradient-bg:     linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --gradient-card:   linear-gradient(135deg, rgba(124, 58, 237, 0.02), rgba(59, 130, 246, 0.01));
    
    /* Shadows */
    --shadow-glow:     0 0 40px rgba(124, 58, 237, 0.03);
    --shadow-card:     0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Specific elements overrides in light-mode */
:root.light-mode body {
    background: var(--gradient-bg);
    color: var(--text-primary);
}

:root.light-mode #mainNavbar {
    background: rgba(248, 250, 252, 0.85);
    border-bottom: 1px solid var(--border);
}

:root.light-mode .navbar-brand {
    color: #0f172a !important;
}

:root.light-mode .nav-link {
    color: #475569 !important;
}

:root.light-mode .nav-link:hover {
    color: #0f172a !important;
    background: rgba(0, 0, 0, 0.04);
}

:root.light-mode .nav-link.active {
    color: var(--purple) !important;
    background: rgba(124, 58, 237, 0.08);
}

:root.light-mode .prompt-text,
:root.light-mode .prompt-text-history {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

:root.light-mode .input-dark {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

:root.light-mode .input-dark:focus {
    background: #ffffff !important;
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

:root.light-mode .category-option {
    background: #ffffff;
}

:root.light-mode .category-option:hover {
    background: rgba(124, 58, 237, 0.05);
}

:root.light-mode .category-option.selected {
    background: rgba(124, 58, 237, 0.08);
    border-color: var(--purple);
}

:root.light-mode .history-card,
:root.light-mode .history-card-full,
:root.light-mode .auth-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: var(--shadow-card);
}

:root.light-mode .history-card:hover,
:root.light-mode .history-card-full:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

:root.light-mode .text-light,
:root.light-mode h5.text-light {
    color: #0f172a !important;
}

:root.light-mode .navbar-user-badge {
    background: rgba(124, 58, 237, 0.08);
    color: var(--purple);
}

:root.light-mode .footer {
    background: rgba(248, 250, 252, 0.8);
    border-top: 1px solid var(--border);
}


/* ============================================================
   25. KEYFRAME ANIMATIONS [NEW]
============================================================ */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-stars {
    display: inline-block;
    animation: spin-slow 8s infinite linear;
}

