:root {
    --bg-primary: #0a0c14;
    --bg-secondary: #111422;
    --glass-bg: rgba(20, 24, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent-blue: #00f2fe;
    --accent-purple: #4facfe;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --card-hover: rgba(255, 255, 255, 0.02);
    --sidebar-width: 260px;
}

body.theme-emerald {
    --bg-primary: #05120a;
    --bg-secondary: #0c1c11;
    --glass-bg: rgba(12, 28, 17, 0.6);
    --accent-blue: #10b981;
    --accent-purple: #34d399;
}

body.theme-ruby {
    --bg-primary: #120507;
    --bg-secondary: #1f0c0e;
    --glass-bg: rgba(31, 12, 14, 0.6);
    --accent-blue: #f43f5e;
    --accent-purple: #fb7185;
}

body.theme-platinum {
    --bg-primary: #f5f2eb; /* Sıcak bej kağıt tonu */
    --bg-secondary: #fdfbf7; /* Yumuşak fildişi panel arka planı */
    --glass-bg: rgba(253, 251, 247, 0.85);
    --glass-border: rgba(45, 41, 35, 0.08);
    --accent-blue: #1d4ed8; /* Okunabilir asil koyu mavi */
    --accent-purple: #6d28d9; /* Asil koyu mor */
    --text-primary: #2d2a25; /* Göz yormayan koyu kahvemsi gri */
    --text-secondary: #6b6459; /* Yumuşak gri-kahve ikincil metin */
    --card-hover: rgba(45, 41, 35, 0.02);
}

/* Açık Temada HTML Inline Stil Ezicileri (Form Elemanları) */
body.theme-platinum select,
body.theme-platinum input,
body.theme-platinum option,
body.theme-platinum textarea {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
}

/* Açık Temada Yapay Zeka Rapor Yazıları İçin Gece Mavisi Kontrastı */
body.theme-platinum .ai-content,
body.theme-platinum .ai-content-text,
body.theme-platinum #detail-local-pdf-content,
body.theme-platinum #modal-local-pdf-content,
body.theme-platinum #pdf-analysis-result-content,
body.theme-platinum .ai-box,
body.theme-platinum .ai-box p,
body.theme-platinum .ai-box li,
body.theme-platinum .ai-box h3,
body.theme-platinum .ai-box h4 {
    color: #112244 !important; /* Gece Mavisi */
    font-weight: 500 !important;
}

body.theme-platinum .ai-box {
    background: rgba(17, 34, 68, 0.05) !important;
    border: 1px solid rgba(17, 34, 68, 0.15) !important;
}

/* Açık Temada Strateji Bilgi Kutusu Gece Mavisi Düzeltmesi */
body.theme-platinum #strategy-info-box {
    background: rgba(17, 34, 68, 0.03) !important;
    border: 1px solid rgba(17, 34, 68, 0.15) !important;
}

body.theme-platinum #strategy-info-title {
    color: #112244 !important;
}

body.theme-platinum #strategy-info-description,
body.theme-platinum #strategy-info-description strong {
    color: #112244 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.nav-item.active {
    border-left: 3px solid var(--accent-blue);
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.api-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green { background-color: var(--success); }
.status-dot.red { background-color: var(--danger); }

/* Main Content Area */
.content-area {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.top-header h1 {
    font-size: 2rem;
    font-weight: 600;
}

.ticker-search-wrapper {
    display: flex;
    gap: 0.75rem;
}

select, input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

select:focus, input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.2);
}

/* Glassmorphism Panel */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Control Panel */
.control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.control-group.small input {
    width: 100px;
}

.dynamic-params {
    display: flex;
    gap: 1rem;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: var(--bg-primary);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
}

.status-card:hover {
    background-color: var(--card-hover);
    transform: translateY(-3px);
}

.card-icon {
    font-size: 2.25rem;
}

.card-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.card-info .value {
    font-size: 1.6rem;
    font-weight: 700;
}

.card-info .sub-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Workspace Grid (Grafik Üstte, YZ Yorumu Altta Tek Sütun Yerleşim) */
.main-workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-panel {
    height: 480px;
    display: flex;
    flex-direction: column;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 360px;
    margin-top: 1rem;
}

.ai-translator-panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.spark {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.15) 0%, rgba(79, 172, 254, 0.15) 100%);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

.ai-content {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-line;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin-top: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}

th {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--glass-border);
}

tr:not(:last-child) {
    border-bottom: 1px solid var(--glass-border);
}

tr:hover {
    background-color: var(--card-hover);
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Form Elements */
.max-width-600 {
    max-width: 600px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.success-message {
    color: var(--success);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================
   BIST EXPLORER 5.0: MODAL (POP-UP) STİLLERİ
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 6, 12, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.modal-content {
    width: 95%;
    max-width: 960px; /* Yatay dikdörtgen için genişlik artırıldı */
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    max-height: 90vh;
    overflow: hidden; /* Dış çerçevedeki scrollbar kaldırıldı */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-stat-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.85rem;
    text-align: center;
}

.modal-stat-box small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.modal-stat-box span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.ai-box {
    background: rgba(16, 24, 48, 0.8);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.ai-box h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--accent-blue);
}

.ai-content-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-line;
}

/* Robot Gösterge Simge Stili */
.ai-status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-left: 0.4rem;
    cursor: pointer;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Satır Tıklanabilirlik Efekti */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

/* ==========================================
   BIST EXPLORER 6.0: ULTRA DETAY MODAL CSS
   ========================================== */
.modal-section-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 3px solid var(--accent-blue);
    padding-left: 0.5rem;
}

.averages-table th, .averages-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.averages-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.modal-averages-table-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem;
}

/* Detail Period Buttons */
.detail-period-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.detail-period-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.detail-period-btn.active {
    background: var(--accent-blue);
    color: #0a0f1d;
    font-weight: 700;
}

/* Grafik Tuval (Canvas) Temizliği */
canvas {
    background-color: var(--bg-secondary) !important;
    border-radius: 12px;
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
}

/* Dashboard Portföy Seçim Dropdown & Option Görünürlük Düzeltmesi */
#dash-portfolio-select {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
}

#dash-portfolio-select option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}



/* ========================================== */
/* 🔑 GİRİŞ (LOGIN) EKRANI TEMA BİLEŞENLERİ  */
/* ========================================== */

.login-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 12, 20, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.login-card {
    background: rgba(17, 20, 34, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2.5rem 2.25rem;
    border-radius: 18px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.login-title {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-size: 1.65rem;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.login-subtitle {
    margin: 0 0 1.75rem 0;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.4;
}

.login-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.login-label {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(10, 14, 26, 0.7) !important;
    color: #ffffff !important;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.login-input:focus {
    border-color: #00f2fe !important;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
    background: rgba(15, 23, 42, 0.9) !important;
}

.login-submit-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff !important;
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.6);
    background: linear-gradient(135deg, #0369a1, #1d4ed8) !important;
}

.login-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 1.25rem;
    min-height: 1.2rem;
    font-weight: 600;
}

/* ========================================== */
/* ☀️ AÇIK TEMA (PLATINUM) UYARLAMASI        */
/* ========================================== */

body.theme-platinum .login-modal-backdrop {
    background: rgba(245, 242, 235, 0.94);
}

body.theme-platinum .login-card {
    background: #ffffff;
    border: 1px solid rgba(45, 41, 35, 0.12);
    box-shadow: 0 20px 45px -10px rgba(45, 41, 35, 0.15), 0 0 20px rgba(29, 78, 216, 0.08);
}

body.theme-platinum .login-title {
    color: #2d2a25;
}

body.theme-platinum .login-subtitle {
    color: #6b6459;
}

body.theme-platinum .login-label {
    color: #6b6459;
}

body.theme-platinum .login-input {
    background: #f8fafc !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

body.theme-platinum .login-input:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 12px rgba(29, 78, 216, 0.25);
    background: #ffffff !important;
}

body.theme-platinum .login-submit-btn {
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.35);
}

body.theme-platinum .login-submit-btn:hover {
    background: linear-gradient(135deg, #1e40af, #1d4ed8) !important;
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.5);
}
