/* ==========================================================================
   GENERATOR PAGE - REDESIGN & DARK MODE CONSISTENCY
   ========================================================================== */

/* ===== VARIABLES & GLOBAL SETTINGS ===== */
:root {
    --generator-primary: #6366f1;
    --generator-primary-hover: #4f46e5;
    --generator-success: #22c55e;
    --generator-success-hover: #16a34a;
    --generator-danger: #ef4444;
    --transition-main: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   DONATION SIDEBAR & TOGGLE
   ========================================================================== */

/* --- Sidebar Panel --- */
.donation-sidebar {
    position: fixed;
    top: 70px; /* Align below navbar */
    right: -360px; /* Hidden by default */
    width: 350px;
    height: calc(100vh - 70px);
    z-index: 1050;
    padding: 1.5rem;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.donation-sidebar.open {
    right: 0; /* Slide in to view */
}

body:not(.light-mode) .donation-sidebar {
    background: var(--dark-surface);
    border-left: 1px solid var(--dark-border);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
}

body.light-mode .donation-sidebar {
    background: var(--light-surface);
    border-left: 1px solid var(--light-border);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
}

/* --- Sidebar Header --- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

body:not(.light-mode) .sidebar-header {
    border-bottom: 1px solid var(--dark-border);
}

body.light-mode .sidebar-header {
    border-bottom: 1px solid var(--light-border);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

body:not(.light-mode) .sidebar-title { color: var(--dark-text); }
body.light-mode .sidebar-title { color: var(--light-text); }

.close-sidebar {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-main);
}

body:not(.light-mode) .close-sidebar { color: var(--dark-text-secondary); }
body.light-mode .close-sidebar { color: var(--light-text-secondary); }

.close-sidebar:hover {
    transform: rotate(90deg);
    background: rgba(128, 128, 128, 0.1);
}

/* --- Sidebar Content --- */
.donation-description {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

body:not(.light-mode) .donation-description { color: var(--dark-text-secondary); }
body.light-mode .donation-description { color: var(--light-text-secondary); }

.donation-option {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: var(--transition-main);
}

body:not(.light-mode) .donation-option {
    background: var(--dark-surface-light);
    border: 1px solid var(--dark-border);
}

body.light-mode .donation-option {
    background: var(--light-surface-dark);
    border: 1px solid var(--light-border);
}

.donation-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.donation-option h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

body:not(.light-mode) .donation-option h4 { color: var(--dark-text); }
body.light-mode .donation-option h4 { color: var(--light-text); }

.donation-option p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

body:not(.light-mode) .donation-option p { color: var(--dark-text-secondary); }
body.light-mode .donation-option p { color: var(--light-text-secondary); }

.donation-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-main);
    background: var(--generator-primary);
    color: white;
}

.donation-btn:hover {
    background: var(--generator-primary-hover);
    transform: translateY(-2px);
}

.donation-btn.share-btn {
    background: var(--dark-surface-light);
    color: var(--dark-text);
}

body.light-mode .donation-btn.share-btn {
    background: var(--light-border);
    color: var(--light-text);
}

/* --- Toggle Button --- */
.donation-toggle {
    position: fixed;
    top: 150px;
    right: 0;
    padding: 1rem 0.75rem;
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 1040;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: -3px 3px 15px rgba(0,0,0,0.1);
}

body:not(.light-mode) .donation-toggle {
    background: var(--generator-primary);
    color: white;
}

body.light-mode .donation-toggle {
    background: var(--generator-primary);
    color: white;
}

.donation-toggle:hover {
    background: var(--generator-primary-hover);
    padding-right: 1rem; /* Extend on hover */
}

/* ==========================================================================
   MAIN LAYOUT & HEADER
   ========================================================================== */

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

.generator-header {
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    border-radius: 16px;
}

body:not(.light-mode) .generator-header {
    background: linear-gradient(135deg, var(--dark-surface) 0%, #2c3a4f 100%);
    border: 1px solid var(--dark-border);
}

body.light-mode .generator-header {
    background: linear-gradient(135deg, var(--light-surface) 0%, #f0f4f9 100%);
    border: 1px solid var(--light-border);
}

.generator-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

body:not(.light-mode) .generator-title { color: var(--dark-text); }
body.light-mode .generator-title { color: var(--light-text); }

.generator-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
}

body:not(.light-mode) .generator-subtitle { color: var(--dark-text-secondary); }
body.light-mode .generator-subtitle { color: var(--light-text-secondary); }

/* ==========================================================================
   GENERATOR CARD & FORMS
   ========================================================================== */

.generator-card {
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 3rem;
}

body:not(.light-mode) .generator-card {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
}

body.light-mode .generator-card {
    background: var(--light-surface);
    border: 1px solid var(--light-border);
}

.generator-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
}

body:not(.light-mode) .generator-card .card-header { border-bottom: 1px solid var(--dark-border); }
body.light-mode .generator-card .card-header { border-bottom: 1px solid var(--light-border); }

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

body:not(.light-mode) .card-title { color: var(--dark-text); }
body.light-mode .card-title { color: var(--light-text); }

.card-badge {
    background: var(--generator-primary);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.template-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* --- Forms & Inputs --- */
.option-group {
    margin-bottom: 1.5rem;
}

.option-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

body:not(.light-mode) .option-label { color: var(--dark-text); }
body.light-mode .option-label { color: var(--light-text); }

.form-select, .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition-main);
}

body:not(.light-mode) .form-select, 
body:not(.light-mode) .form-control {
    background: var(--dark-surface-light);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
}

body.light-mode .form-select, 
body.light-mode .form-control {
    background: var(--light-surface-dark);
    border: 1px solid var(--light-border);
    color: var(--light-text);
}

.form-select:focus, .form-control:focus {
    border-color: var(--generator-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}

.select-wrapper {
    position: relative;
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--generator-primary);
}

.template-options-container {
    margin: 1.5rem 0;
}

.template-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    border-radius: 12px;
}

body:not(.light-mode) .template-placeholder {
    background: var(--dark-surface-light);
    color: var(--dark-text-secondary);
}

body.light-mode .template-placeholder {
    background: var(--light-surface-dark);
    color: var(--light-text-secondary);
}

.template-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.generate-btn {
    width: 100%;
    background: var(--generator-success);
    color: white;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    margin-top: 1rem;
}

.generate-btn:hover {
    background: var(--generator-success-hover);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

/* --- Output Panel --- */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.output-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

body:not(.light-mode) .output-title { color: var(--dark-text); }
body.light-mode .output-title { color: var(--light-text); }

.output-actions { display: flex; gap: 0.5rem; }

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-main);
}

body:not(.light-mode) .action-btn {
    background: var(--dark-surface-light);
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
}

body.light-mode .action-btn {
    background: var(--light-surface-dark);
    border: 1px solid var(--light-border);
    color: var(--light-text);
}

.action-btn:hover {
    background: var(--generator-primary);
    border-color: var(--generator-primary);
    color: white;
}

.script-output {
    min-height: 400px;
    padding: 1.5rem;
    border-radius: 12px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

body:not(.light-mode) .script-output {
    background: #1a1f2e; /* Slightly different dark for code */
    border: 1px solid var(--dark-border);
    color: #e2e8f0;
}

body.light-mode .script-output {
    background: #f8f9fa;
    border: 1px solid var(--light-border);
    color: #212529;
}

.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 350px;
    opacity: 0.7;
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */

.features-section {
    margin-top: 3rem;
    padding: 2rem 0;
}

.features-section .section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

body:not(.light-mode) .features-section .section-title { color: var(--dark-text); }
body.light-mode .features-section .section-title { color: var(--light-text); }

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

.feature-card {
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition-main);
}

body:not(.light-mode) .feature-card {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
}

body.light-mode .feature-card {
    background: var(--light-surface);
    border: 1px solid var(--light-border);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--generator-primary);
    transition: var(--transition-main);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

body:not(.light-mode) .feature-title { color: var(--dark-text); }
body.light-mode .feature-title { color: var(--light-text); }

.feature-desc {
    font-size: 0.9rem;
    line-height: 1.6;
}

body:not(.light-mode) .feature-desc { color: var(--dark-text-secondary); }
body.light-mode .feature-desc { color: var(--light-text-secondary); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.generator-footer {
    margin-top: 3rem;
    padding: 2.5rem;
    text-align: center;
    border-radius: 16px;
}

body:not(.light-mode) .generator-footer {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
}

body.light-mode .generator-footer {
    background: var(--light-surface);
    border: 1px solid var(--light-border);
}

.generator-footer p {
    margin-bottom: 0.5rem;
}

body:not(.light-mode) .generator-footer p { color: var(--dark-text-secondary); }
body.light-mode .generator-footer p { color: var(--light-text-secondary); }

.footer-donate-btn {
    background: var(--generator-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
    cursor: pointer;
    transition: var(--transition-main);
}

.footer-donate-btn:hover {
    background: var(--generator-primary-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 992px) {
    .template-selector {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .generator-title { font-size: 1.75rem; }
    .generator-subtitle { font-size: 1rem; }
    .generator-card, .generator-header, .feature-card, .generator-footer { padding: 1.5rem; }
    .donation-sidebar { width: 300px; right: -310px; }
}

/* ==========================================================================
   SEO CONTENT & FAQ SECTIONS
   ========================================================================== */

.seo-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.seo-card {
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

body:not(.light-mode) .seo-card {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
}

body.light-mode .seo-card {
    background: var(--light-surface);
    border: 1px solid var(--light-border);
}

.seo-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

body:not(.light-mode) .seo-title { color: var(--dark-text); }
body.light-mode .seo-title { color: #2c3e50; }

.seo-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

body:not(.light-mode) .seo-text { color: var(--dark-text-secondary); }
body.light-mode .seo-text { color: #555; }

.seo-text-small {
    font-size: 1rem;
    line-height: 1.7;
}

body:not(.light-mode) .seo-text-small { color: var(--dark-text-secondary); }
body.light-mode .seo-text-small { color: #666; }

/* FAQ Styles */
.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-left: 4px solid;
    border-radius: 0 8px 8px 0;
}

body:not(.light-mode) .faq-item {
    background: var(--dark-surface-light);
}

body.light-mode .faq-item {
    background: #f8f9fa;
}

.faq-question {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

body:not(.light-mode) .faq-question { color: var(--dark-text); }
body.light-mode .faq-question { color: #2c3e50; }

.faq-answer {
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
}

body:not(.light-mode) .faq-answer { color: var(--dark-text-secondary); }
body.light-mode .faq-answer { color: #666; }

/* Feature Grid in SEO Section */
.seo-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.seo-feature-item {
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid;
}

body:not(.light-mode) .seo-feature-item {
    border-color: var(--dark-border);
    background: var(--dark-surface-light);
}

body.light-mode .seo-feature-item {
    border-color: #e0e0e0;
    background: white;
}

.seo-feature-title {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

/* Colors for feature titles remain same in both modes or adjusted slightly */
.seo-feature-desc {
    font-size: 0.95rem;
    line-height: 1.6;
}

body:not(.light-mode) .seo-feature-desc { color: var(--dark-text-secondary); }
body.light-mode .seo-feature-desc { color: #666; }

.seo-summary-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
}

body:not(.light-mode) .seo-summary-box {
    background: var(--dark-surface-light);
}

body.light-mode .seo-summary-box {
    background: #f8f9fa;
}

.seo-summary-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

body:not(.light-mode) .seo-summary-title { color: var(--dark-text); }
body.light-mode .seo-summary-title { color: #2c3e50; }

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--generator-success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    font-weight: 600;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
