@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
    --bg-main: #0B0A0F;
    --bg-panel: #16151A;
    --border-color: #2A2833;
    --text-primary: #FFFFFF;
    --text-sec: #9CA3AF;
    --accent-glow: rgba(138, 43, 226, 0.4);
    --gradient-primary: linear-gradient(135deg, #8A2BE2, #4169E1);
    --gradient-secondary: linear-gradient(135deg, #FF1493, #8A2BE2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Typography Specifics */
h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 30px;
    height: 30px;
    background: var(--gradient-primary);
    border-radius: 8px;
    box-shadow: 0 0 15px var(--accent-glow);
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.nav-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: var(--text-sec);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    background: var(--gradient-primary);
    border-radius: 0 4px 4px 0;
}

.spacer { flex-grow: 1; }

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #333;
    background-image: url('https://ui-avatars.com/api/?name=User&background=random');
    background-size: cover;
}

.user-info {
    font-size: 0.85rem;
}
.user-credits {
    color: #4169E1;
    font-weight: 600;
}

/* Main Content Area */
.main-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

.header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 40px;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    background: rgba(11, 10, 15, 0.8);
    z-index: 5;
}

.content-wrapper {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Studio Controls */
.studio-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

/* Subtle glow behind the studio box */
.studio-box::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--accent-glow);
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.prompt-area {
    position: relative;
    z-index: 1;
}

.prompt-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.prompt-input:focus {
    outline: none;
    border-color: #8A2BE2;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.2);
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    z-index: 1;
    position: relative;
}

.style-pills {
    display: flex;
    gap: 10px;
}

.pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-sec);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill:hover, .pill.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: #8A2BE2;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(65, 105, 225, 0.5);
}

/* Loading animations */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    background-size: 200% 100%;
    animation: shimmerAnim 1.5s infinite linear;
}

@keyframes shimmerAnim {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.enhancing-active {
    border-color: #FF1493 !important;
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.2) !important;
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 10px rgba(255, 20, 147, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 20, 147, 0.5); }
    100% { box-shadow: 0 0 10px rgba(255, 20, 147, 0.2); }
}

/* Scene/Storyboard Timeline */
.timeline-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
}

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

.scene-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.scene-card:hover {
    transform: translateY(-5px);
    border-color: #4169E1;
}

.scene-video-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.scene-video-placeholder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-info {
    padding: 15px;
}

.scene-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.scene-desc {
    font-size: 0.85rem;
    color: var(--text-sec);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-panel);
    border-left: 4px solid #8A2BE2;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    margin-top: 10px;
    position: absolute;
    bottom: 0;
    left: 0;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-secondary);
    width: 0%;
    transition: width 0.3s linear;
}

/* --- MEGA APP NEW STYLES --- */

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

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-sec);
    margin-bottom: 10px;
    padding-left: 10px;
}

.nav-group {
    margin-bottom: 15px;
}

.view-panel {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-panel.active-view {
    display: block;
}

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

/* Engine Specific Glows */
.box-glow-blue::before { background: rgba(65, 105, 225, 0.4); }
.box-glow-pink::before { background: rgba(255, 20, 147, 0.3); }
.box-glow-amber::before { background: rgba(255, 140, 0, 0.25); }
.box-glow-purple::before { background: rgba(138, 43, 226, 0.5); }

/* Exclusive Badge */
.exclusive-badge {
    position: absolute;
    top: 25px;
    right: 25px;
    background: linear-gradient(90deg, #FF1493, #8A2BE2);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    z-index: 2;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 40px;
    text-align: center;
    color: var(--text-sec);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    z-index: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: #8A2BE2;
    background: rgba(138, 43, 226, 0.05);
    color: var(--text-primary);
}

/* Fullscreen Media Modal */
.media-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.media-modal.open {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content img, .modal-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(138, 43, 226, 0.3);
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transform: scale(1.5);
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #fff;
    transform: scale(1.7);
}

/* Make placeholders clickable */
.scene-video-placeholder.clickable {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}
.scene-video-placeholder.clickable:hover {
    transform: scale(1.02);
}
