/* --- MINIMAL FOOTER --- */
.site-footer {
    border-top: 1px solid #1f1f23;
    padding: 50px 20px;
    margin-top: auto; /* Pushes to bottom */
    background: #050505;
    text-align: center;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-brand {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.footer-nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: #71717a;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #F59E0B;
}

.footer-copy {
    color: #3f3f46;
    font-size: 0.75rem;
    margin-top: 10px;
}

/* --- SEO FOOTER (2-COLUMN, QUICK LINKS) --- */
.site-footer-seo {
    border-top: 1px solid #1f1f23;
    padding: 40px 20px;
    margin-top: auto;
    background: #050505;
}

.footer-content-seo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1000px;
    margin: 0 auto;
    gap: 32px;
}

.site-footer-seo .footer-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-footer-seo .footer-brand-name {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    margin: 0;
}

.site-footer-seo .footer-left .footer-copy,
.site-footer-seo .footer-left .disclaimer {
    color: #6b7280;
    font-size: 0.8rem;
    margin: 0;
}

.site-footer-seo .footer-quick-links-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.site-footer-seo .footer-quick-links-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 10px;
}

.site-footer-seo .footer-quick-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.site-footer-seo .footer-quick-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.site-footer-seo .footer-quick-links a:hover {
    color: #F59E0B;
}

@media (max-width: 640px) {
    .footer-content-seo {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .site-footer-seo .footer-quick-links-col {
        align-items: center;
    }
    .site-footer-seo .footer-quick-links {
        align-items: center;
    }
}

/* --- ARTICLE READING LAYOUT --- */
.article-page-layout {
    display: flex;
    justify-content: center; /* Center the whole block */
    gap: 40px;
    padding: 0 20px;
    max-width: 1400px; /* Limit total page width */
    margin: 0 auto;
    position: relative;
}

/* The Main Content Column */
.article-main-column {
    flex: 1; /* Take available space */
    max-width: 800px; /* <--- CRITICAL: Stops text from getting too wide */
    min-width: 0; /* Prevents flex items from overflowing */
}

/* The Content Itself (Typography) */
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e4e4e7;
    margin-top: 2rem;
}

.article-body h1, .article-body h2, .article-body h3 {
    color: #fff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul, .article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body img {
    max-width: 100%; /* Ensure images don't break layout */
    border-radius: 12px;
    margin: 2rem 0;
}

/* --- MARKDOWN CONTENT STYLING --- */
.article-body h2 {
    font-size: 1.8rem;
    color: #ffffff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #F59E0B; /* Orange accent line */
    padding-left: 15px;
}

.article-body h3 {
    font-size: 1.4rem;
    color: #e4e4e7;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.article-body ul, .article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: #d1d5db;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body strong {
    color: #F59E0B; /* Highlight bold text in orange */
}

.article-body blockquote {
    background: #18181b;
    border-left: 4px solid #F59E0B;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    color: #a1a1aa;
    border-radius: 0 8px 8px 0;
}

.article-body code {
    background: #27272a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #F59E0B;
}

/* Additional markdown elements */
.article-body h4 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #e4e4e7; }
.article-body a { color: #F59E0B; text-decoration: none; border-bottom: 1px solid rgba(245, 158, 11, 0.3); transition: color 0.2s, border-color 0.2s; }
.article-body a:hover { color: #fbbf24; border-bottom-color: #F59E0B; }
.article-body pre {
    background: #0f0f11;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.article-body pre code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
}
.article-body hr { border: none; border-top: 1px solid #27272a; margin: 2rem 0; }

/* The Sidebar (Action Panel) */
.article-sidebar {
    width: 320px; /* Fixed width for the action panel (Like, Share, Discussion) */
    flex-shrink: 0; /* Never shrink */
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* --- Share on X Button --- */
.x-share-btn {
    background-color: #000000 !important; /* X Black */
    color: #ffffff !important;
    border: 1px solid #333 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.x-share-btn:hover {
    background-color: #1a1a1a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* --- Follow Card (Premium Look) --- */
.x-follow-card {
    margin-top: 4rem;
    background: linear-gradient(145deg, #101010, #000000);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Glow Effect behind icon */
.x-icon-wrapper {
    background: #000;
    padding: 12px;
    border-radius: 50%;
    border: 1px solid #333;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-follow-card .x-text h3 {
    font-size: 1.4rem;
    color: white;
    margin-bottom: 0.5rem;
}
.x-follow-card .x-text p {
    color: #a1a1aa;
    font-size: 0.95rem;
    margin: 0;
}

.x-follow-btn {
    margin-left: auto; /* Push to right */
    background: white;
    color: black;
    padding: 10px 24px;
    border-radius: 24px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.x-follow-btn:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .x-follow-card { flex-direction: column; text-align: center; }
    .x-follow-btn { margin-left: 0; width: 100%; text-align: center; }
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .article-page-layout {
        flex-direction: column;
    }
    .article-sidebar {
        width: 100%;
        position: static;
        background: transparent;
        border-top: none;
        padding: 0;
        z-index: auto;
        display: block;
        order: 2; /* Ensure sidebar comes after main content */
    }
    .article-main-column {
        max-width: 100%;
        margin-bottom: 0;
        order: 1;
    }
}

/* --- CHARACTER KEEPER TOOL --- */
.keeper-page-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.keeper-page-title {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.keeper-page-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.keeper-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    background: #0f0f11;
    border: 1px solid #27272a;
    border-radius: 16px;
    padding: 28px;
}

.keeper-section-title {
    color: #e4e4e7;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Keeper form: input groups (dark background, light text) */
.keeper-container .input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.keeper-container .input-group:last-child {
    margin-bottom: 0;
}

.keeper-container .input-group label {
    color: #a1a1aa;
    font-size: 0.85rem;
    font-weight: 500;
}

.keeper-container .input-group input,
.keeper-container .input-group textarea {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 10px;
    color: #fff;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.keeper-container .input-group input::placeholder,
.keeper-container .input-group textarea::placeholder {
    color: #52525b;
}

.keeper-container .input-group input:focus,
.keeper-container .input-group textarea:focus {
    outline: none;
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Action grid for scenario buttons */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    color: #e4e4e7;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.action-card i {
    font-size: 1.5rem;
    color: #F59E0B;
}

.action-card:hover {
    background: #27272a;
    border-color: #F59E0B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.action-card:active {
    transform: translateY(0);
}

/* Output area and copy button */
.keeper-output-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.keeper-output {
    width: 100%;
    min-height: 140px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 10px;
    color: #e4e4e7;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.keeper-output::placeholder {
    color: #52525b;
}

.keeper-copy-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #F59E0B;
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.keeper-copy-btn:hover {
    background: #fbbf24;
    transform: translateY(-1px);
}

/* NEW badge for sidebar nav item */
.badge-new {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f97316;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.sidebar-link.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-icon,
.nav-icon-clapper {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

/* --- DIRECTOR'S CUT (full tool layout) --- */
body.dark-theme {
    background: #0a0a0b;
    color: #e4e4e7;
    margin: 0;
    min-height: 100vh;
}

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

/* Tool page sidebar */
.app-container .sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #0f0f11;
    border-right: 1px solid #27272a;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.app-container .sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.app-container .sidebar .logo img {
    height: 36px;
    width: auto;
}

.app-container .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-container .nav-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}

.app-container .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #F59E0B;
}

.app-container .nav-item i {
    font-size: 1rem;
}

.main-content.tool-layout {
    flex: 1;
    padding: 32px 28px 48px;
    overflow-y: auto;
}

.tool-header {
    margin-bottom: 28px;
}

.tool-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-header h1 i {
    color: #F59E0B;
}

.tool-header p {
    color: #94a3b8;
    font-size: 0.95rem;
    margin: 0;
}

.directors-studio {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
}

.directors-studio .card {
    background: #0f0f11;
    border: 1px solid #27272a;
    border-radius: 16px;
    padding: 24px;
}

.directors-studio .card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e4e4e7;
    margin: 0 0 20px 0;
}

/* Actor panel & output panel inputs */
.directors-studio .input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.directors-studio .input-group:last-child {
    margin-bottom: 0;
}

.directors-studio .input-group label {
    color: #a1a1aa;
    font-size: 0.85rem;
    font-weight: 500;
}

.directors-studio .input-group input,
.directors-studio .input-group textarea {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 10px;
    color: #fff;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.directors-studio .input-group input::placeholder,
.directors-studio .input-group textarea::placeholder {
    color: #52525b;
}

.directors-studio .input-group input:focus,
.directors-studio .input-group textarea:focus {
    outline: none;
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.directors-studio .input-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Action panel grid */
.directors-studio .action-panel .action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.scene-btn {
    padding: 16px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    color: #e4e4e7;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.scene-btn:hover {
    background: #27272a;
    border-color: #F59E0B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.scene-btn.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: #F59E0B;
    color: #F59E0B;
}

.output-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.output-wrapper textarea#finalPrompt,
.directors-studio .output-panel textarea {
    width: 100%;
    min-height: 140px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 10px;
    color: #e4e4e7;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.output-wrapper textarea::placeholder {
    color: #52525b;
}

.copy-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #F59E0B;
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.copy-btn:hover {
    background: #fbbf24;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .app-container .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #27272a;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .main-content.tool-layout {
        padding: 20px 16px 32px;
    }
    .directors-studio .action-panel .action-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Director's Cut: Premium Cinematic UI */
.tool-layout {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    background: radial-gradient(circle at top center, rgba(255, 215, 0, 0.05), transparent 70%);
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.tool-header h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #fff, #ffd700, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.directors-studio {
    display: grid;
    grid-template-columns: 350px 1fr; /* Fixed Sidebar for Actor, Fluid for Actions */
    gap: 2rem;
    align-items: start;
}

/* Glassmorphism Cards */
.card {
    background: rgba(24, 24, 27, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #71717a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card h3 i { color: #ffd700; }

/* Actor Panel Inputs */
.input-group label {
    font-size: 0.8rem;
    color: #a1a1aa;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.input-group input, 
.input-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #3f3f46;
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.2s;
}

.input-group input:focus, 
.input-group textarea:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
    background: rgba(0, 0, 0, 0.6);
}

/* Action Grid Buttons */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.scene-btn {
    background: rgba(39, 39, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    color: #d4d4d8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.scene-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    transform: translateY(-4px);
    color: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.scene-btn.active {
    background: #ffd700;
    color: #000;
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

/* Final Prompt Output */
.output-panel {
    grid-column: span 2;
    margin-top: 1rem;
    border: 1px solid #ffd700; /* Gold Border */
    background: rgba(0, 0, 0, 0.8);
}

.output-wrapper { position: relative; }

#finalPrompt {
    width: 100%;
    height: 100px;
    background: transparent;
    border: none;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
}

.copy-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #ffd700;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}
.copy-btn:hover { transform: scale(1.05); }

/* Responsive */
@media (max-width: 900px) {
    .directors-studio { grid-template-columns: 1fr; }
    .output-panel { grid-column: span 1; }
}

/* --- PROMPT CARDS: Edge-to-edge images (no gray gaps) --- */
.prompt-card,
.gallery-container .card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    overflow: hidden;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.prompt-card img,
.gallery-container .card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin: 0;
    border-bottom: 1px solid #27272a;
}

.prompt-card .card-content,
.prompt-card .card-body,
.prompt-card .prompt-info,
.gallery-container .card .card-content,
.gallery-container .card .card-body,
.gallery-container .card .card-info,
.gallery-container .card .prompt-info {
    padding: 1.2rem;
}

.film-strip-header {
    margin: 0;
    width: 100%;
}
