/*
Theme Name: Movie Content Automator (Premium App)
Theme URI: https://example.com/movie-bot
Author: Antigravity AI
Author URI: https://example.com
Description: A premium, dynamic frontend web app that allows users to instantly generate highly engaging Swahili movie stories via AI and fetch posters using TMDB data.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: movie-content-automator
*/

/* --- Base & Variables --- */
:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    /* Premium Dark Gradient Background */
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark), #020617);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

/* --- Layout --- */
.mbot-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mbot-header {
    text-align: center;
    margin-bottom: 40px;
}

.mbot-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.mbot-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Glassmorphism App Container --- */
.mbot-app-container {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--glow);
}

/* --- Controls / Tabs --- */
.mbot-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.mbot-search-box {
    flex: 1;
    display: flex;
    gap: 10px;
}

.mbot-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.mbot-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.mbot-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mbot-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.4);
}

.mbot-btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.mbot-btn-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    box-shadow: none;
}

.mbot-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- Results Area --- */
.mbot-results-area {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mbot-empty-state {
    text-align: center;
    color: var(--text-muted);
}

.mbot-empty-state i {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* --- Generated Content Layout --- */
.mbot-result-card {
    display: none;
    /* Shown via JS */
    width: 100%;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mbot-result-card.active {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.mbot-poster-col {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mbot-poster-col img.main-poster {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s ease;
}

.mbot-poster-col img.main-poster:hover {
    transform: scale(1.02);
}

/* Image Carousel Grid */
.mbot-img-carousel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mbot-img-carousel img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border 0.3s;
}

.mbot-img-carousel img:hover {
    border-color: var(--primary);
}


.mbot-content-col {
    display: flex;
    flex-direction: column;
}

.mbot-movie-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.mbot-story-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 16px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
    white-space: pre-wrap;
    /* Keeps formatting from AI */
}

.mbot-actions {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* --- Loader Animation --- */
.mbot-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mbot-loader.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- Animations --- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .mbot-result-card.active {
        grid-template-columns: 1fr;
    }

    .mbot-controls {
        flex-direction: column;
    }

    .mbot-poster-col img {
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
}