/* ===== PWA & Mobil Uyumluluk ===== */
:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(15, 23, 42, 0.6);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

/* PWA tam ekran modu */
@media display-mode: standalone {
    body {
        padding-top: calc(var(--safe-top) + 8px);
    }
}

/* Mobil dokunma iyileştirmeleri */
button, a, input, select, textarea {
    touch-action: manipulation;
}

button {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

input, select, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Scroll çubuğu */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Modal mobil uyumluluk */
@media (max-width: 768px) {
    .binance-runtime-status {
        width: 100%;
        margin: 14px auto 22px;
    }

    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh !important;
        margin: 5vh auto !important;
        border-radius: 16px !important;
    }
    
    .insider-table-wrapper {
        max-height: 50vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        padding: 10px !important;
    }
    
    .header {
        padding: 15px 10px !important;
    }
    
    .search-container {
        flex-direction: column !important;
    }
    
    .search-container button {
        width: 100%;
    }
    
    .action-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .calendar-tabs, .prepost-cats {
        flex-wrap: wrap;
    }
    
    .calendar-tab, .prepost-cats button {
        min-height: 40px;
        flex: 1;
        min-width: 80px;
    }
}

/* Çok küçük ekranlar */
@media (max-width: 360px) {
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.1rem; }
}

/* Yatay mod */
@media (orientation: landscape) and (max-height: 500px) {
    .modal-content {
        max-height: 95vh !important;
    }
    
    .header {
        padding: 10px !important;
    }
}

/* Dokunma için minimum boyut */
@media (pointer: coarse) {
    button, a, input[type="checkbox"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    input[type="text"], input[type="number"], input[type="password"], select {
        min-height: 48px;
        font-size: 16px;
    }
}

/* Background Blobs for Glassmorphism Effect */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 60px;
}

.binance-runtime-status {
    width: min(100%, 560px);
    height: auto;
    min-height: 58px;
    margin: 18px auto 28px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(240, 185, 11, 0.28);
    background: linear-gradient(135deg, rgba(240, 185, 11, 0.12), rgba(15, 23, 42, 0.78));
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(14px);
}

.binance-runtime-status:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(240, 185, 11, 0.18), rgba(15, 23, 42, 0.86));
    box-shadow: 0 14px 36px rgba(2, 6, 23, 0.3);
}

.binance-runtime-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #f0b90b;
    background: rgba(240, 185, 11, 0.14);
    border: 1px solid rgba(240, 185, 11, 0.3);
    font-size: 1.25rem;
    font-weight: 800;
}

.binance-runtime-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.binance-runtime-copy strong {
    font-size: 0.88rem;
    line-height: 1.2;
}

.binance-runtime-copy small {
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: normal;
}

.binance-runtime-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.12);
}

.binance-runtime-status.is-running {
    border-color: rgba(34, 197, 94, 0.38);
}

.binance-runtime-status.is-running .binance-runtime-dot {
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.13), 0 0 16px rgba(34, 197, 94, 0.65);
}

.binance-runtime-status.is-warning .binance-runtime-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.13);
}

.binance-runtime-status.is-stopped .binance-runtime-dot {
    background: #94a3b8;
}

.binance-runtime-status.is-error {
    border-color: rgba(239, 68, 68, 0.42);
}

.binance-runtime-status.is-error .binance-runtime-dot {
    background: #ef4444;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.13);
}

.binance-runtime-status.is-checking .binance-runtime-dot {
    animation: binance-status-pulse 1.2s ease-in-out infinite;
}

@keyframes binance-status-pulse {
    50% { opacity: 0.35; transform: scale(0.78); }
}

.binance-connection-result {
    margin: -4px 0 14px;
    padding: 9px 11px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.42);
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.45;
}

.binance-connection-result.is-success { color: #86efac; border-color: rgba(34, 197, 94, 0.34); background: rgba(34, 197, 94, 0.08); }
.binance-connection-result.is-error { color: #fca5a5; border-color: rgba(239, 68, 68, 0.34); background: rgba(239, 68, 68, 0.08); }
.binance-connection-result.is-checking { color: #fde68a; border-color: rgba(240, 185, 11, 0.3); }
.binance-connection-result.is-warning { color: #fde68a; border-color: rgba(245, 158, 11, 0.38); background: rgba(245, 158, 11, 0.09); }

.binance-positions-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.binance-positions-heading h3 { margin: 0; }

.binance-refresh-btn {
    width: auto;
    height: 32px;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 9px;
    background: rgba(59, 130, 246, 0.13);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: #93c5fd;
    font-size: 0.72rem;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    color: var(--accent);
    background: none;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: var(--accent);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* Search */
.search-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto 24px;
    position: relative;
    z-index: 9999;
    background: var(--input-bg);
    border-radius: 50px;
    padding: 6px;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 20px rgba(0,0,0,0.3);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: #fff;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

input::placeholder {
    color: #64748b;
}

button {
    background: var(--accent);
    color: #fff;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    transform: scale(1.05);
    background: #2563eb;
    box-shadow: 0 0 15px var(--accent-glow);
}

button:active {
    transform: scale(0.95);
}

/* Tags */
.tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Status Message */
.status-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 40px 0;
    min-height: 24px;
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* News Card - Glassmorphism */
.news-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* overflow: hidden; Removed to allow HIGH IMPACT badge to pop out */
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px; /* Keeps hover effect inside the rounded corners */
}

.news-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

.news-card:hover::before {
    opacity: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.news-source {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.news-date {
    color: var(--text-secondary);
}

.news-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    margin-top: 8px;
}
.ai-popover {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 90%;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.news-card:hover .ai-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* Dokunmatik ekranda özet düğmeyle açılır ve kartın içinde gösterilir */
.ai-summarize-btn {
    display: none;
    align-self: flex-start;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}
@media (hover: none) {
    .ai-summarize-btn { display: inline-block; }
    .news-card:hover .ai-popover:not(.open) { opacity: 0; visibility: hidden; }
}
.ai-popover.open {
    position: static;
    transform: none;
    width: auto;
    margin-top: 10px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.ai-popover.open::after { display: none; }
.news-card:hover .ai-popover.open { transform: none; }

.ai-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: rgba(139, 92, 246, 0.5) transparent transparent transparent;
}
.read-more {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    transition: gap 0.2s ease;
}

.news-card:hover .read-more {
    gap: 12px;
}

/* Entry Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.5s ease backwards;
}

/* Stagger card animations */
.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }

/* Trend Dashboard */
.trend-dashboard {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeInUp 0.5s ease backwards;
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.trend-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Why Did It Move? bar */
.why-moved-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.35);
}
.why-moved-bar-title {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: white;
}
.why-moved-bar-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 3px;
}
.why-moved-bar .why-moved-btn {
    flex-shrink: 0;
}

#totalNewsCount {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.trend-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.stat-item.positive .stat-value { color: #34d399; }
.stat-item.neutral .stat-value { color: #d1d5db; }
.stat-item.negative .stat-value { color: #f87171; }

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: flex;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.positive-bar { background: #10b981; }
.neutral-bar { background: #6b7280; }
.negative-bar { background: #ef4444; }

/* Advanced Analytics Badges & Glows */
.topic-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 10px;
    margin-right: 5px;
}

.impact-glow {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3), inset 0 0 20px rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
}

.impact-glow::after {
    content: 'HIGH IMPACT';
    position: absolute;
    top: -10px;
    left: 24px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    z-index: 2;
}

.tier-1 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tier-1::after {
    content: 'âœ“';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: bold;
}

.tier-2 {
    color: #fbbf24;
}

.tier-2::after {
    content: 'Analysis';
    font-size: 0.65rem;
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* Sentiment Badges */
.sentiment-badge {
    position: absolute;
    bottom: 24px;
    right: 24px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(0.5);
}

.badge-positive {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.badge-negative {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.badge-neutral {
    background: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
    border-color: rgba(156, 163, 175, 0.3);
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .logo { font-size: 2.5rem; }
    .news-grid { grid-template-columns: 1fr; }
}

/* Settings & Modal */
.settings-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
}

.why-moved-btn {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}
.why-moved-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.45);
    filter: brightness(1.1);
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    margin: 10vh auto;
    padding: 30px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Calendar List */
.calendar-tabs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.calendar-tab {
    flex: 1;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.calendar-tab:hover {
    background: rgba(255, 255, 255, 0.08);
}
.calendar-tab.active {
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

/* Pre/Post Market Movers category buttons */
.prepost-cats {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.prepost-cats .calendar-tab {
    flex: 0 1 auto;
    padding: 7px 14px;
    font-size: 0.85rem;
}

/* Institutional Holdings summary chips */
.inst-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.inst-chip {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.inst-chip .inst-chip-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.inst-chip .inst-chip-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
}
.calendar-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}
.calendar-list::-webkit-scrollbar {
    width: 6px;
}
.calendar-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.calendar-list::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}
.calendar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.3s ease;
}
.calendar-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.calendar-ticker {
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
}
.calendar-date {
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.sec-form-badge {
    display: inline-block;
    padding: 3px 9px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 8px;
    letter-spacing: 0.3px;
}
.sec-open-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.sec-open-btn:hover {
    background: rgba(139, 92, 246, 0.4);
}

/* Price Alert Modal */
.alert-form {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.alert-form input,
.alert-form select {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
}

.alert-form input:focus,
.alert-form select:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
}

.alert-form #alertTickerInput { width: 100%; }
#alertDirection { flex: 1; min-width: 150px; }
#alertPriceInput { width: 110px; flex-shrink: 0; }
#alertAddBtn { padding: 10px 18px; flex-shrink: 0; }

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.alert-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.alert-item-ticker {
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
}

.alert-item-direction {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
}

.alert-item-direction.above {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
}

.alert-item-direction.below {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

.alert-item-price {
    font-size: 1rem;
    color: var(--text-secondary);
}

.alert-item-current {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.alert-item-current.triggered {
    color: #f59e0b;
}

.alert-delete-btn {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: #f87171;
    font-size: 1.1rem;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.alert-delete-btn:hover {
    background: rgba(239, 68, 68, 0.35);
}

.search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.close-btn:hover {
    color: white;
}

/* Earnings Banner */
.earnings-banner {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    animation: pulse-banner 2s infinite;
}

@keyframes pulse-banner {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Sentiment Change Alert Banner */
.sentiment-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
    animation: pulse-banner-red 2s infinite;
}

@keyframes pulse-banner-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.sentiment-banner.alert-style {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
    animation: pulse-banner-blue 2s infinite;
}

@keyframes pulse-banner-blue {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.banner-summary-btn {
    margin-left: auto;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border: none;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.4);
}
.banner-summary-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* SEC EDGAR Filing Alert Banner */
.sec-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #f59e0b, #8b5cf6);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
    animation: pulse-banner-gold 2s infinite;
}

@keyframes pulse-banner-gold {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Dividend Alert Banner */
.dividend-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
    animation: pulse-banner-green 2s infinite;
}

@keyframes pulse-banner-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.div-amount-badge {
    display: inline-block;
    padding: 3px 9px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 8px;
}

/* Short Interest Radar */
.short-progress {
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.short-score {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 10px;
    white-space: nowrap;
}
.short-score.very-high {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.5);
}
.short-score.high {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.5);
}
.short-score.medium {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.5);
}
.short-score.low {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
tr.short-row-highlight td {
    background: rgba(239, 68, 68, 0.06);
}

/* Earnings Reaction Dashboard */
.earnings-reaction-dashboard {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
}

.er-avg {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.er-avg.positive { color: #34d399; }
.er-avg.negative { color: #f87171; }

.er-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.er-bars {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-top: 15px;
    height: 120px;
}

.er-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.er-bar-val {
    font-size: 0.8rem;
    font-weight: 600;
}

.er-bar-val.positive { color: #34d399; }
.er-bar-val.negative { color: #f87171; }

.er-bar {
    width: 60%;
    max-width: 48px;
    border-radius: 6px 6px 0 0;
    min-height: 4px;
}

.er-bar.positive { background: linear-gradient(180deg, #34d399, #10b981); }
.er-bar.negative { background: linear-gradient(180deg, #f87171, #ef4444); }

.er-bar-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Sentiment Delta Badge */.sentiment-delta {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.sentiment-delta.positive { color: #34d399; border-color: rgba(52, 211, 153, 0.3); }
.sentiment-delta.negative { color: #f87171; border-color: rgba(248, 113, 113, 0.3); }
.sentiment-delta.flat { color: #d1d5db; border-color: rgba(209, 213, 219, 0.3); }

/* Portfolio Feed Button */
.portfolio-feed-btn {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.portfolio-feed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #7c3aed, #db2777);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider {
  background-color: #8b5cf6;
}
input:checked + .slider:before {
  transform: translateX(18px);
}
.slider.round {
  border-radius: 22px;
}
.slider.round:before {
  border-radius: 50%;
}

.tv-chart-container {
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: var(--card-bg);
}

/* Ana grafik: araç çubuğu (periyot butonları + canlı kaynak rozeti) */
.main-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255,255,255,0.02);
}

.mc-intervals {
    display: flex;
    gap: 6px;
}

.mc-int-btn {
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mc-int-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.mc-int-btn.active {
    color: #fff;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.mc-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.mc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
}

.mc-dot.live {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,0.9);
    animation: mcPulse 2s infinite;
}

.mc-dot.stale {
    background: #f59e0b;
}

@keyframes mcPulse {
    0% { opacity: 1; }
    50% { opacity: 0.45; }
    100% { opacity: 1; }
}

#mainChartEl {
    height: calc(100% - 42px - 24px);
    width: 100%;
    position: relative;
}

/* Grafik alti tarih/saat seridi (hover'da basilan mum) */
.mc-timebar {
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    border-top: 1px solid var(--card-border);
    background: rgba(255,255,255,0.02);
    white-space: nowrap;
    overflow: hidden;
}

.mc-legend {
    position: absolute;
    top: 8px;
    left: 12px;
    z-index: 5;
    pointer-events: none;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.75);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--card-border);
    white-space: nowrap;
}

.mc-legend b {
    color: var(--text-primary);
}

.mc-legend .up {
    color: #22c55e;
}

.mc-legend .down {
    color: #ef4444;
}

#apiKeyInput {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-family: 'Inter', sans-serif;
    margin-top: 10px;
    margin-bottom: 10px;
}

.modal-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* AI Summary Specifics */
.ai-summary-loading {
    color: #c4b5fd;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.ai-sparkle {
    display: inline-block;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    margin-right: 4px;
}

.model-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.model-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: grab;
    transition: background 0.2s, box-shadow 0.2s;
}

.model-item:active {
    cursor: grabbing;
}

.model-item.dragging {
    opacity: 0.5;
    background: rgba(139, 92, 246, 0.1);
    border: 1px dashed #8b5cf6;
}

.drag-grip {
    color: var(--text-secondary);
    margin-right: 12px;
    font-size: 1.2rem;
    user-select: none;
}

.model-item.drag-over-top {
    border-top: 2px solid #8b5cf6;
}


.model-item.drag-over-bottom {
    border-bottom: 2px solid #8b5cf6;
}

/* AI Chat */
.ai-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s ease;
}
.ai-chat-btn:hover {
    transform: scale(1.1);
}

.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-header h3 { margin: 0; font-size: 1.1rem; }
.chat-header-actions { display: flex; align-items: center; gap: 12px; }
.chat-new-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}
.chat-new-btn:hover { color: white; border-color: rgba(139, 92, 246, 0.6); }
.close-chat { cursor: pointer; font-size: 1.5rem; color: var(--text-secondary); }
.close-chat:hover { color: white; }

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-message {
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
}
.bot-message {
    background: rgba(139, 92, 246, 0.2);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.user-message {
    background: rgba(59, 130, 246, 0.2);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.bot-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.system-message {
    align-self: center;
    max-width: 95%;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
}
.chat-cite {
    color: #c4b5fd;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8em;
    vertical-align: super;
    margin: 0 1px;
}
a.chat-cite:hover { text-decoration: underline; }
.chat-new-btn { white-space: nowrap; width: auto; height: auto; box-shadow: none; transform: none; }
.chat-new-btn:hover, .chat-new-btn:active { background: rgba(255, 255, 255, 0.12); transform: none; box-shadow: none; }
.chat-footer input { min-width: 0; }
.chat-footer button { flex-shrink: 0; white-space: nowrap; min-width: 72px; }
@media (max-width: 480px) {
    .ai-chat-window { left: 12px; right: 12px; width: auto; bottom: 96px; height: min(500px, calc(100dvh - 120px)); }
}
.chat-footer button.chat-stop { background: #ef4444; }

/* News AI Aşama 2: hazır sorular, AI etki etiketi, benzer haber kümeleri */
.chat-presets {
    display: flex;
    gap: 6px;
    padding: 8px 15px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.chat-presets::-webkit-scrollbar { display: none; }
.chat-presets .chat-preset {
    flex-shrink: 0;
    width: auto;
    height: auto;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.12);
    color: #ddd6fe;
    font-size: 0.78rem;
    white-space: nowrap;
    box-shadow: none;
}
.chat-presets .chat-preset:hover { background: rgba(139, 92, 246, 0.28); transform: none; box-shadow: none; }
.chat-presets .chat-preset:active { transform: none; }
.chat-presets .chat-preset-brief { border-color: rgba(52, 211, 153, 0.5); background: rgba(16, 185, 129, 0.12); color: #a7f3d0; }
.news-ai-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 12px; }
/* Kartın ::before parlama katmanı tıklamayı yutmasın: kart içindeki düğmeler onun üstünde */
.news-ai-row, .ai-summarize-btn { position: relative; z-index: 2; }
.impact-chip, .cluster-toggle {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}
.impact-chip.impact-4, .impact-chip.impact-5 { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.12); }
.impact-chip.impact-3 { color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.cluster-toggle { cursor: pointer; color: #c4b5fd; border-color: rgba(139, 92, 246, 0.45); user-select: none; }
.cluster-toggle:hover { background: rgba(139, 92, 246, 0.2); }
.news-card.cluster-follower { border-style: dashed; }
.news-card.cluster-hidden { display: none; }

/* News AI Aşama 3: sohbet geçmişi paneli ve önemli haber bildirimi ayarı */
.chat-history-panel {
    flex: 1;
    overflow-y: auto;
    padding: 12px 15px;
    background: rgba(15, 23, 42, 0.98);
}
.chat-history-panel[hidden] { display: none; }
.ai-chat-window.history-open .chat-body, .ai-chat-window.history-open .chat-presets { display: none; }
.chat-history-note { margin: 0 0 10px; font-size: 0.8rem; color: var(--text-secondary); }
.chat-history-item { display: flex; align-items: stretch; gap: 6px; margin-bottom: 6px; }
.chat-history-item button { width: auto; height: auto; border-radius: 10px; box-shadow: none; transform: none; }
.chat-history-item button:hover, .chat-history-item button:active { transform: none; box-shadow: none; }
.chat-history-open {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}
.chat-history-open:hover { background: rgba(139, 92, 246, 0.18); }
.chat-history-open small { color: var(--text-secondary); font-size: 0.72rem; }
.chat-history-item.active .chat-history-open { border-color: rgba(139, 92, 246, 0.6); }
.chat-history-del { padding: 0 10px; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; font-size: 1rem; }
.chat-history-del:hover { background: rgba(239, 68, 68, 0.25); }
/* News AI: bağlam etiketi ve $ hisse önerileri */
.chat-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-scope { font-size: 0.72rem; color: #c4b5fd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.chat-suggest { display: flex; flex-direction: column; gap: 2px; padding: 6px 15px 0; max-height: 180px; overflow-y: auto; }
.chat-suggest[hidden] { display: none; }
.chat-suggest .chat-suggest-item {
    display: flex; gap: 8px; align-items: baseline; width: 100%; height: auto; padding: 6px 10px;
    border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary); font-size: 0.82rem; text-align: left; box-shadow: none; transform: none;
}
.chat-suggest .chat-suggest-item:hover { background: rgba(139, 92, 246, 0.2); transform: none; box-shadow: none; }
.chat-suggest .chat-suggest-item span { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preset[hidden] { display: none; }
.news-watch-box { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.news-watch-box h3 { margin: 0 0 8px; font-size: 1rem; }
.news-watch-label { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; line-height: 1.4; cursor: pointer; }
.news-watch-label input[type=checkbox] { margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px; padding: 0; }
.news-watch-hint { margin: 6px 0 0; font-size: 0.8rem; color: var(--text-secondary); }
.chat-footer button.chat-stop:hover { background: #dc2626; }

.chat-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}
.chat-footer input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    outline: none;
}
.chat-footer button {
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.chat-footer button:hover {
    background: #7c3aed;
}



.watchlist-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.ticker-name-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
}

.fear-greed-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.fear-greed-container h4 {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gauge-wrapper {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 0 auto;
}

.gauge {
    position: relative;
    width: 200px;
    height: 100px;
    overflow: hidden;
}

.gauge-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg at 50% 50%,
        #ef4444 0deg,
        #f59e0b 45deg,
        #10b981 180deg
    );
    border: 20px solid var(--bg-surface);
    box-sizing: border-box;
}

.gauge-needle {
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 4px;
    height: 85px;
    background-color: #fff;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-90deg); /* -90 = Extreme Fear, 90 = Extreme Greed, 0 = Neutral */
    border-radius: 4px;
    transition: transform 1.5s cubic-bezier(0.4, 2.5, 0.3, 1);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 10;
}

.gauge-needle::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

.fear-greed-text {
    margin-top: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

/* Insider Trading Table */
.insider-table-wrapper {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.insider-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.insider-table th {
    position: sticky;
    top: 0;
    background: #1e293b; /* Solid color to prevent rows showing through */
    z-index: 10; /* Ensure header stays on top */
    color: var(--text-secondary);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.insider-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.insider-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.insider-table td.insider-buy {
    color: #10b981;
    font-weight: 600;
}

.insider-table td.insider-sell {
    color: #ef4444;
    font-weight: 600;
}

/* Autocomplete Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
}

.suggestion-item {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(255,255,255,0.1);
}

.suggestion-item.active {
    background: rgba(255,255,255,0.15);
}

.suggestion-ticker {
    font-weight: 700;
    color: var(--accent-primary);
}

.suggestion-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Ticker Price Animations */
.ticker-price {
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.3s ease, background-color 0.3s ease;
    color: var(--text-secondary);
}

.flash-green {
    animation: flash-green-anim 1.5s ease-out forwards;
}
.ticker-price.flash-green {
    transition: none !important;
}

.flash-red {
    animation: flash-red-anim 1.5s ease-out forwards;
}
.ticker-price.flash-red {
    transition: none !important;
}

@keyframes flash-green-anim {
    0% { background-color: #10b981; color: #ffffff; }
    100% { background-color: transparent; color: #34d399; }
}

@keyframes flash-red-anim {
    0% { background-color: #ef4444; color: #ffffff; }
    100% { background-color: transparent; color: #f87171; }
}

/* Favori listesi kalici yon renkleri (ilk boyama) */
.ticker-price.wl-up { color: #34d399; }
.ticker-price.wl-down { color: #f87171; }



.inst-delta {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 500;
}

.inst-new {
    color: var(--accent-primary, #3b82f6);
    font-weight: 600;
}
/* Financials Grid */
.financials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.financial-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}
.financial-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}
.financial-card-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.financial-card-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}




#quickActionsBar > div {
    justify-content: center !important;
}

@media (max-width: 768px) {
    #quickActionsBar {
        margin: 10px 0 !important;
        padding: 10px !important;
    }
    #quickActionsBar > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    #quickActionsBar button {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 0.95rem !important;
        padding: 12px 16px !important;
        text-align: left !important;
    }
    #quickActionsBar span {
        text-align: center !important;
        font-size: 1rem !important;
        margin-bottom: 4px !important;
        display: block !important;
    }
}

/* Quick Actions Bar - Tum Ekranlar */
#quickActionsBar {
    overflow: visible !important;
}

#quickActionsBar > div {
    justify-content: center !important;
}

#quickActionsBar button {
    flex: 1 !important;
    min-width: 180px !important;
    text-align: center !important;
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}

#quickActionsBar button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3) !important;
}

@media (max-width: 768px) {
    #quickActionsBar {
        margin: 10px 0 !important;
        padding: 10px !important;
    }
    #quickActionsBar > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    #quickActionsBar button {
        width: 100% !important;
        min-width: unset !important;
        min-height: 48px !important;
        font-size: 0.95rem !important;
        padding: 12px 16px !important;
    }
    #quickActionsBar span {
        text-align: center !important;
        font-size: 1rem !important;
        margin-bottom: 4px !important;
        display: block !important;
    }
}

/* ============================================================
   Supabase Auth ekrani + kullanici rozeti
   ============================================================ */
.auth-overlay {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at top, rgba(59,130,246,0.08), transparent 60%), #0f172a;
    padding: 16px; overflow-y: auto;
}
.auth-card {
    width: 100%; max-width: 400px;
    background: #111a2e;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: authIn .25s ease-out;
}
@keyframes authIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-logo { font-size: 2rem; display: block; margin-bottom: 6px; }
.auth-brand h1 { font-family: 'Outfit', sans-serif; font-size: 1.5rem; color: var(--text-primary); margin: 0 0 4px; }
.auth-brand p { color: var(--text-secondary); font-size: .85rem; margin: 0; }
.auth-title { font-family: 'Outfit', sans-serif; font-size: 1.15rem; color: var(--text-primary); text-align: center; margin: 8px 0 10px; }
.auth-text { color: var(--text-secondary); font-size: .86rem; text-align: center; line-height: 1.5; margin: 0 0 14px; }
.auth-note { color: var(--text-secondary); font-size: .74rem; line-height: 1.45; margin: 12px 0 0; }
.auth-field { display: block; margin-bottom: 12px; }
.auth-field span { display: block; font-size: .78rem; color: var(--text-secondary); margin-bottom: 5px; }
.auth-field input {
    width: 100%; box-sizing: border-box;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 11px 13px;
    color: var(--text-primary);
    font-size: .95rem;
    outline: none;
    transition: border-color .15s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.auth-btn {
    width: 100%; box-sizing: border-box;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none; border-radius: 10px;
    padding: 12px 16px; margin-top: 4px;
    color: #fff; font-size: .95rem; font-weight: 600;
    cursor: pointer;
    transition: filter .15s, transform .1s;
}
.auth-btn:hover:not(:disabled) { filter: brightness(1.12); }
.auth-btn:active:not(:disabled) { transform: scale(.99); }
.auth-btn:disabled { opacity: .55; cursor: wait; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.auth-links a { color: #60a5fa; font-size: .82rem; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-msg { border-radius: 9px; padding: 9px 12px; font-size: .8rem; line-height: 1.4; margin-bottom: 12px; }
.auth-msg-err { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; }
.auth-msg-ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.auth-pending { text-align: center; font-size: 2.4rem; margin-bottom: 4px; }
.auth-loading { text-align: center; color: var(--text-secondary); font-size: .9rem; padding: 30px 0; }

/* ---- Hesap menusu (AI Settings yaninda) ---- */
.user-menu-wrap { position: relative; display: inline-flex; align-items: center; }
#user-chip {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(59,130,246,.45);
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 60%, #60a5fa 100%);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: .95rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 0 rgba(59,130,246,.4);
    transition: box-shadow .18s ease, transform .18s ease;
}
#user-chip:hover { transform: translateY(-1px); box-shadow: 0 0 0 5px rgba(59,130,246,.18); }
#user-chip.active { box-shadow: 0 0 0 6px rgba(59,130,246,.22); }
.user-menu {
    position: absolute; top: calc(100% + 10px); right: 0;
    min-width: 208px;
    background: #111c31;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 20px 55px rgba(0,0,0,.55);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-6px) scale(.97);
    transform-origin: top right;
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
    z-index: 12000;
}
.user-menu.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
.um-name {
    padding: 10px 12px 11px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: .86rem; font-weight: 700;
    display: flex; flex-direction: column; gap: 3px;
    word-break: break-all;
}
.um-mail { color: var(--text-secondary); font-size: .72rem; font-weight: 500; }
.um-item {
    width: 100%;
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px;
    border: none; border-radius: 9px;
    background: transparent;
    color: var(--text-primary);
    font-size: .8rem; font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .14s ease;
}
.um-item:hover { background: rgba(59,130,246,.13); }
.um-item .um-ico { font-size: .95rem; line-height: 1; }
.um-item.um-danger { color: #fca5a5; }
.um-item.um-danger:hover { background: rgba(239,68,68,.14); }

/* ---- Sifre degistirme modal ---- */
.pw-overlay {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(2,6,23,.72);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pw-card {
    width: 100%; max-width: 360px;
    background: #111c31;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 22px 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.pw-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pw-head .auth-title { margin: 0; }
.pw-close {
    cursor: pointer; color: var(--text-secondary);
    font-size: 1rem; line-height: 1; padding: 4px 6px; border-radius: 8px;
}
.pw-close:hover { color: var(--text-primary); background: rgba(255,255,255,.06); }

/* ---- Admin Paneli ---- */
.admin-user-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--card-border);
    gap: 12px;
}
.admin-user-row:last-child { border-bottom: none; }
.admin-user-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.admin-user-info strong { color: var(--text-primary); font-size: .95rem; }
.admin-user-email { color: var(--text-secondary); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-date { color: var(--text-secondary); font-size: .75rem; }
.admin-user-status { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-status-badge {
    font-size: .75rem; padding: 2px 8px; border-radius: 10px; font-weight: 500;
}
.admin-status-badge.admin-approved { background: rgba(34,197,94,.15); color: #22c55e; }
.admin-status-badge.admin-pending { background: rgba(234,179,8,.15); color: #eab308; }
.admin-btn {
    font-size: .78rem; padding: 4px 12px; border-radius: 8px; border: none;
    cursor: pointer; font-weight: 500; transition: all .15s ease;
}
.admin-btn.approve { background: #22c55e; color: #fff; }
.admin-btn.approve:hover { background: #16a34a; }
.admin-btn.reject { background: #ef4444; color: #fff; }
.admin-btn.reject:hover { background: #dc2626; }
.admin-btn:disabled { opacity: .5; cursor: not-allowed; }
.admin-badge {
    font-size: .7rem; padding: 2px 8px; border-radius: 10px;
    background: rgba(139,92,246,.15); color: #8b5cf6; font-weight: 600;
}
.um-admin { color: #8b5cf6 !important; }
.um-admin:hover { background: rgba(139,92,246,.1) !important; }
.auth-text-sm { font-size: .85rem; color: var(--text-secondary); }

/* ---- Mobil uyarlama: hesap menusu dar ekranda ---- */
@media (max-width: 768px) {
    #user-chip { width: 34px; height: 34px; font-size: .85rem; }
    .user-menu { right: -6px; min-width: 196px; }
}

/* ---- Kar/Zarar Cetveli ---- */
.pl-wrap { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
.pl-ruler-btn {
    position: absolute; top: 8px; right: 8px;
    pointer-events: auto;
    width: 32px; height: 32px;
    border-radius: 9px;
    border: 1px solid var(--card-border);
    background: rgba(17,26,46,.88);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all .15s ease;
}
.pl-ruler-btn:hover { color: #93c5fd; border-color: rgba(59,130,246,.45); }
.pl-ruler-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border-color: rgba(59,130,246,.7);
    box-shadow: 0 0 14px rgba(59,130,246,.5);
}
.pl-measuring canvas { cursor: crosshair !important; }
.pl-zone { position: absolute; left: 0; display: none; pointer-events: none; }
.pl-tag {
    position: absolute; display: none;
    pointer-events: none;
    white-space: nowrap;
    font-size: .72rem; font-weight: 700;
    color: var(--text-primary);
    background: rgba(10,16,32,.94);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 5px 11px;
    box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.pl-tag .pl-dir { margin-right: 4px; font-size: .68rem; }
.pl-tag .pl-sub { color: var(--text-secondary); font-weight: 500; margin-left: 6px; }

/* ---- Kar/Zarar Cetveli v2: arac cubugu butonu ---- */
.mc-ruler-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 26px;
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s ease;
    flex: 0 0 auto;
}
.mc-ruler-btn:hover { color: #93c5fd; border-color: rgba(59,130,246,.45); }
.mc-ruler-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border-color: rgba(59,130,246,.7);
    box-shadow: 0 0 12px rgba(59,130,246,.45);
}
.pl-zone { border-top: 1px solid transparent; border-bottom: 1px solid transparent; }

/* AI ozet + belge modallari her zaman liste modallarinin ustunde */
#secSummaryModal, #secDocModal, #kapDocModal { z-index: 10200; }

/* ---- Canli formasyon takibi: manuel yenileme ---- */
.pa-refresh-btn {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, .42);
    background: rgba(56, 189, 248, .10);
    color: #7dd3fc;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity .15s ease, border-color .15s ease, background .15s ease;
}
.pa-refresh-btn:hover:not(:disabled) {
    border-color: rgba(56, 189, 248, .72);
    background: rgba(56, 189, 248, .18);
}
.pa-refresh-btn:disabled { cursor: wait; opacity: .62; }
.pa-refresh-btn.is-error {
    border-color: rgba(239, 68, 68, .5);
    background: rgba(239, 68, 68, .12);
    color: #f87171;
}

/* ---- Mobil: ana grafik arac cubugunda cetveli gorunur tut ---- */
@media (max-width: 640px) {
    .main-chart-toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
    }
    .mc-intervals {
        order: 1;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .mc-intervals::-webkit-scrollbar { display: none; }
    .mc-int-btn { padding: 5px 11px; flex: 0 0 auto; }
    #mcRulerBtn {
        order: 2;
        margin-left: auto;
        width: 34px;
        height: 30px;
    }
    .mc-source { order: 3; }
}
/* AI provider settings */
.ai-provider-settings label { display: block; margin: 14px 0 6px; font-weight: 500; }
.ai-provider-settings input, .ai-provider-settings select {
    box-sizing: border-box; width: 100%; min-height: 42px; padding: 10px 12px;
    color: var(--text-primary); background: var(--bg-secondary, #182032);
    border: 1px solid var(--card-border); border-radius: 8px; font: inherit;
}
.ai-provider-settings p { color: var(--text-secondary); font-size: .83rem; line-height: 1.6; margin: 8px 0 12px; }
.ai-provider-settings .analyze-btn { margin: 10px 0; justify-content: center; width: 100%; min-height: 42px; border-radius: 10px; }
.ai-provider-settings .ai-remote-heading { margin-top: 24px; }
.ai-bridge-guide { margin-top: 16px; font-size: .83rem; line-height: 1.65; }
.ai-bridge-guide summary { cursor: pointer; }
.ai-bridge-guide ol { padding-left: 22px; }
.ai-bridge-guide li { margin: 10px 0; }
.ai-bridge-guide a { color: var(--accent); }
.ai-bridge-guide code { overflow-wrap: anywhere; }
#aiBridgeStatus { overflow-wrap: anywhere; }
#aiBridgeStatus.ai-bridge-error { color: #f87171; }
#aiBridgeStatus.ai-bridge-status { color: #34d399; }

/* Admin Paneli: Supabase aktarma köprüleri */
.admin-section-title { margin: 18px 0 8px; font-size: 1rem; }
.admin-bridge-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin-bridge-add input { flex: 1 1 180px; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05); color: inherit; }
.admin-pair-code { font-size: 1.05rem; letter-spacing: .06em; user-select: all; }
.admin-btn.admin-relay-toggle { background: #475569; color: #fff; margin-left: 6px; }
.admin-btn.admin-relay-toggle.on { background: #2563eb; }
.ai-bridge-mode-hint { font-size: .8rem; color: var(--text-secondary); }
