:root {
    --bg-dark: #0d0b14;
    --bg-panel: #15141f;
    --border-color: #2a2835;
    --accent-color: #d946ef;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top-navbar {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-navbar .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.top-navbar .nav-link:hover,
.top-navbar .nav-link.active {
    background-color: rgba(217, 70, 239, 0.1);
    color: var(--accent-color);
}

.main-content {
    padding: 2rem;
}



.custom-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    height: 100%;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.href {
    text-decoration: none;
    color: var(--text-main);
}

.card-project-detail {
    padding: 0 20px 0 20px;
}

.custom-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.card-img-wrapper {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    background-color: #000;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.custom-card:hover img {
    opacity: 1;
}

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

.new-project-card {
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    cursor: pointer;
}

.new-project-card:hover {
    border-color: var(--accent-color);
    background-color: rgba(217, 70, 239, 0.05);
}

.new-project-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.new-project-card:hover .new-project-icon {
    color: var(--accent-color);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.main-body {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

.script-body {
    display: flex;
    flex-grow: 1;
}

/* --- İNCE SOL SIDEBAR --- */
.sidebar {
    background-color: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.project-title-sidebar {
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav .nav-link {
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    cursor: pointer;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: var(--text-main);
    background-color: var(--bg-panel);
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
}

/* --- İÇERİK ALANI --- */
.content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.custom-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
}

.content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
}



.custom-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
}

/* --- Form Stilleri --- */
.form-control,
.form-select {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-dark);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 .25rem rgba(168, 85, 247, .25);
    color: var(--text-main);
}

/* --- Görsel Yükleme Alanları --- */
.image-upload-box {
    background-color: var(--bg-dark);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.image-upload-box:hover {
    border-color: var(--accent-color);
}

.image-upload-box i {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.image-upload-box p {
    margin: 0;
    color: var(--text-muted);
}

.image-upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-upload-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ql-snow .ql-editor pre.ql-syntax {
    background-color: var(--bg-panel) !important;
    font-size: large;
    width: 100% !important;
}

/* Quill Editor Placeholder Rengi */
.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    font-style: italic;
    opacity: 0.6;
}

/* Quill Editor Arka Plan */
.ql-container {
    background-color: var(--bg-dark);
    border-color: var(--border-color) !important;
}

.ql-toolbar {
    background-color: var(--bg-panel);
    border-color: var(--border-color) !important;
}

/* Quill Editor Metin Rengi */
.ql-editor {
    color: var(--text-main);
}

/* Sahne Kartı - Koyu Tema */
.scene-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.scene-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(217, 70, 239, 0.2);
}

/* Sahne Başlık */
.scene-header {
    color: var(--text-main);
    margin-bottom: 15px;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scene-badge {
    background: linear-gradient(135deg, var(--accent-color), #a855f7);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Sahne Bilgileri */
.scene-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 8px 0;
}

.scene-info strong {
    color: var(--accent-color);
}

.scene-description {
    color: var(--text-main);
    margin-top: 15px;
    line-height: 1.6;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.scene-description strong {
    color: var(--accent-color);
}

/* Karakterler Bölümü */
.scene-characters {
    margin-top: 15px;
    background: rgba(217, 70, 239, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(217, 70, 239, 0.2);
}

.scene-characters-title {
    color: var(--accent-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.scene-characters-list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.character-badge {
    display: inline-block;
    background: var(--bg-dark);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--accent-color);
    font-weight: 500;
}

/* Diyaloglar Bölümü */
.scene-dialogues {
    margin-top: 15px;
    background: var(--bg-dark);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.scene-dialogues-title {
    color: #a78bfa;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.dialogue-item {
    margin: 10px 0;
    padding: 10px;
    background: rgba(167, 139, 250, 0.05);
    border-left: 3px solid #a78bfa;
    border-radius: 6px;
}

.dialogue-character {
    color: #a78bfa;
    font-weight: 600;
    font-size: 0.9rem;
}

.dialogue-text {
    color: var(--text-main);
    margin-left: 8px;
    font-size: 0.9rem;
}

/* Ses Efektleri */
.scene-audio {
    margin-top: 15px;
    padding: 12px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.scene-audio-title {
    color: #22c55e;
    font-size: 0.95rem;
    font-weight: 600;
}

.scene-audio {
    color: var(--text-main);
}

/* JSON Fallback */
.scene-json-fallback {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

/* Görselleştir Butonu */
.btn-visualize {
    margin-top: 15px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-decoration: none;
    display: block;
    text-align: center;
    font-size: 0.95rem;
}

.btn-visualize:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
    color: white;
}

.btn-visualize:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

/* Frame Status Container */
.frame-status-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.frame-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.frame-info strong {
    color: var(--text-main);
    font-size: 0.9rem;
}

.frame-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.frame-status.frame-ready {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.frame-status.frame-pending {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Prompt Div - Inactive State */
#promptdiv.inactive {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

#promptdiv.inactive #generate-script-btn {
    opacity: 0.6;
    cursor: not-allowed;
}

.asset-card {
            background: #16161f;
            border: 1px solid #2a2a3e;
            border-radius: 12px;
            padding: 20px;
        }

        .asset-title {
            color: #a78bfa;
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 15px;
        }

        .assets-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }

        .asset-item {
            text-align: center;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .asset-item:hover {
            transform: scale(1.05);
        }

        .asset-item img {
            width: 100%;
            height: 60px;
            object-fit: cover;
            border-radius: 8px;
            border: 2px solid transparent;
            transition: border-color 0.2s;
        }

        .asset-item.selected img {
            border-color: #a78bfa;
        }

        .asset-item span {
            display: block;
            color: #fff;
            font-size: 0.75rem;
            margin-top: 5px;
        }

        .frame-card {
            background: #16161f;
            border: 1px solid #2a2a3e;
            border-radius: 12px;
            padding: 20px;
        }

        .frame-title {
            color: #a78bfa;
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 15px;
            text-align: center;
        }

        .frame-preview {
            width: 100%;
            aspect-ratio: 16/9;
            background: #0a0a0f;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .frame-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .frame-empty {
            text-align: center;
            color: #4a4a5e;
        }

        .frame-empty p {
            margin-top: 10px;
            font-size: 0.9rem;
        }

        .scene-info-card {
            background: #16161f;
            border: 1px solid #2a2a3e;
            border-radius: 12px;
            overflow: hidden;
        }

        .scene-info-header {
            background: #1a1a2e;
            padding: 15px 20px;
            border-bottom: 1px solid #2a2a3e;
        }

        .scene-info-header h5 {
            color: #a78bfa;
            margin: 0;
            font-size: 1rem;
            font-weight: 600;
        }

        .scene-info-body {
            padding: 20px;
            color: #fff;
        }

        .info-item {
            margin-bottom: 10px;
        }

        .info-item strong {
            color: #a78bfa;
        }

        .info-item span, .info-item p {
            color: #d1d5db;
            margin-left: 10px;
        }

        .dialogue-item {
            background: #1a1a2e;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 10px;
        }

        .dialogue-character {
            color: #a78bfa;
            font-weight: 600;
        }

        .dialogue-text {
            color: #d1d5db;
            margin-left: 10px;
        }

        .prompt-card {
            background: #16161f;
            border: 1px solid #2a2a3e;
            border-radius: 12px;
            padding: 10px;
        }

        .prompt-input {
            background: #1a1a2e;
            border: 1px solid #2a2a3e;
            color: #fff;
            padding: 15px;
        }

        .prompt-input::placeholder {
            color: #6b7280;
        }

        .prompt-input:focus {
            background: #1a1a2e;
            border-color: #a78bfa;
            color: #fff;
            box-shadow: 0 0 0 0.2rem rgba(167, 139, 250, 0.25);
        }

        .btn-generate {
            background: #a78bfa;
            border: none;
            color: #fff;
            padding: 0 25px;
            border-radius: 8px;
            transition: all 0.3s;
        }

        .btn-generate:hover {
            background: #8b5cf6;
            transform: scale(1.05);
        }

        .frame-status-container {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.frame-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.frame-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.frame-status.frame-ready {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.frame-status.frame-pending {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

 .video-player-wrapper {
            width: 100%;
            background: #000;
            border-radius: 12px;
            overflow: hidden;
            position: relative;
            aspect-ratio: 16/9;
        }

        .video-player-wrapper video {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .video-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: #4a4a5e;
        }

        .video-empty i {
            margin-bottom: 15px;
        }

        .video-controls {
            padding-top: 15px;
            border-top: 1px solid var(--border-color);
        }

        .video-controls .btn {
            background: var(--bg-dark);
            border: 1px solid var(--border-color);
            color: var(--text-main);
        }

        .video-controls .btn:hover:not(:disabled) {
            background: var(--accent-color);
            border-color: var(--accent-color);
            color: white;
        }

        .video-controls .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .video-controls .btn-primary {
            background: var(--accent-color);
            border-color: var(--accent-color);
            color: white;
        }

                .tick-mark {
            position: absolute;
            background-color: #475569;
            width: 1px;
            bottom: 0;
        }
        .tick-text {
            position: absolute;
            font-size: 10px;
            color: #64748b;
            transform: translateX(-50%);
            top: -18px;
        }
        .timeline-track { cursor: pointer; }
        
        .marker-dot { transition: transform 0.1s; } 
        .marker-dot:hover { transform: scale(1.2); z-index: 50; }
        .marker-dot.dragging { cursor: grabbing; transform: scale(1.1); z-index: 100; box-shadow: 0 0 15px rgba(255,255,255,0.2); }

        .frame-image{
            width: 100%; height: 100%; position: absolute; opacity: 0.5;    background-position: center;
    background-size: cover;
        }

        .frame-image:hover {
            opacity: 1;
        }

                :root{
            /* Dark purple theme (screenshot uyumlu) */
            --bg-dark-900: #0c0710;   /* very dark purple */
            --bg-dark-800: #121018;   /* slightly lighter */
            --bg-panel:     #16121a;  /* panels */
            --muted:        #9aa0bf;  /* subtle muted text */
            --accent:       #b857ff;  /* main purple/magenta accent */
            --accent-2:     #7c3aed;  /* secondary purple tone */
        }


        /* Scrollbar özelleştirme */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: #160a1a; }
        ::-webkit-scrollbar-thumb { background: #3a2350; border-radius: 3px; box-shadow: inset 0 0 4px rgba(0,0,0,0.6); }
        ::-webkit-scrollbar-thumb:hover { background: #5b3b80; }

        /* Senaryo Stilleri */
        .screenplay-content {
            font-family: 'Courier Prime', 'Courier New', monospace;
            line-height: 1.2;
            white-space: pre-wrap; /* Satır sonlarını koru */
        }

        /* Small utility classes to mimic some Tailwind visuals */
        .panel-header { background: linear-gradient(180deg, rgba(20,10,25,0.9), rgba(16,8,20,0.95)); border-bottom: 1px solid rgba(184,129,255,0.06); }
        .panel-footer { background: linear-gradient(180deg, rgba(16,8,20,0.95), rgba(12,6,18,0.96)); border-top: 1px solid rgba(184,129,255,0.04); }
        .muted { color: var(--muted); }
        .accent { color: var(--accent); }
        .btn-accent { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #0b0710; }
        .scene-section { background: transparent; border-bottom: 1px solid rgba(255,255,255,0.04); }

        /* Small pulse animation (approximation) */
        .animate-pulse {
          animation: pulse 1s linear;
        }
        @keyframes pulse {
          0% { opacity: 1; transform: translateY(0px); }
          50% { opacity: .85; transform: translateY(1px); }
          100% { opacity: 1; transform: translateY(0px); }
        }

        .chat-bubble {
            border-radius: 14px;
            padding: .65rem .9rem;
            box-shadow: 0 1px 4px rgba(0,0,0,0.4);
        }

        .chat-bubble p {
            margin-top: 1px;
    margin-bottom: 1px;
        }

        .chat-user { background: linear-gradient(180deg, rgba(184,129,255,0.95), rgba(124,58,237,0.95)); color: #0b0710; }
        .chat-model { background: rgb(85 26 102 / 75%);color: #efe6ff; border: 1px solid rgba(184,129,255,0.06); }

        /* Make content-editor look minimal */
        [contenteditable="true"] { outline: none; padding: .5rem; min-height: 3.2rem; border-radius: .4rem; }
        .text-xs { font-size: .72rem; }
        .text-sm { font-size: .9rem; }

        .row-fit { height: 100vh; }