/* 
    analiz.css - Gelişmiş Pazar Analizi Stilleri
    Modülerleştirilmiş ve optimize edilmiş versiyon.
*/

:root {
    --chart-bg: var(--bg-card);
    --chart-border: var(--border-color);
}

.analysis-container {
    margin-bottom: 4rem;
}

.chart-box {
    background: var(--chart-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--chart-border);
    border-radius: 28px;
    padding: 2.5rem;
    height: 100%;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .chart-box { padding: 1.5rem; }
}
@media (max-width: 640px) {
    .chart-box { padding: 1rem; border-radius: 20px; }
}

.donut-chart {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .donut-chart { width: 180px; height: 180px; }
}

.donut-hole {
    width: 70%;
    height: 70%;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    width: 100%;
}

@media (max-width: 1200px) {
    .share-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 640px) {
    .share-grid {
        grid-template-columns: 1fr;
    }
    .donut-chart { width: 180px; height: 180px; }
}

.share-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 8px 12px;
    background: var(--bg-soft);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: default;
}

.share-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.02);
}

.tech-card {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.tech-card:hover {
    border-color: var(--primary-color);
    background: var(--bg-card);
}

.power-bar {
    height: 44px;
    background: var(--bg-soft);
    border-radius: 14px;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.power-segment {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: width 1s ease-in-out;
}

/* Turkey Map Styles */
#turkey-svg-map {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
    stroke: var(--border-color);
    stroke-width: 0.5px;
    background: var(--bg-card); /* Harita dışı (Arka Plan) */
    border-radius: 24px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
}

#turkey-svg-map path {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
    #turkey-svg-map path:hover {
        fill: var(--primary-color) !important;
        stroke: #fff;
        stroke-width: 1px;
        filter: brightness(1.3);
        z-index: 10;
    }
}

#map-tooltip {
    position: fixed;
    display: none;
    padding: 12px 18px;
    border-radius: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.85rem;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Premium Modal Styles */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.premium-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.premium-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.premium-modal-overlay.active .premium-modal-content {
    transform: translateY(0) scale(1);
}

@media (max-width: 768px) {
    .premium-modal-overlay {
        padding: 10px;
    }
    .premium-modal-content {
        border-radius: 20px;
        max-height: 92vh;
    }
}

/* Removed stat-card definitions to style.css for global standardization */

/* Tabs Styles */
.main-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    background: var(--bg-soft);
    padding: 6px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.main-tabs button {
    padding: 12px 28px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-tabs button i { font-size: 1.1rem; opacity: 0.7; }

.main-tabs button.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.main-tabs button.active i { opacity: 1; }

.main-tabs button:not(.active):hover {
    background: var(--bg-card);
    color: var(--text-light);
}

.tab-content {
    display: none;
    animation: tabFadeIn 0.5s ease;
}

.tab-content.active { display: block; }

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

/* District Analysis Styles */
.district-selector-card {
    background: var(--bg-soft);
    border-radius: 24px;
    padding: 1.5rem 2rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.district-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 1100px) {
    .district-analysis-grid { grid-template-columns: 1fr; }
}

.city-select-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    min-width: 250px;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 45px;
}

.city-select-box:hover, .city-select-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.district-map-card {
    background: var(--bg-soft);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.district-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#district-map-svg {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: transparent; /* Gereksiz katman kaldırıldı */
    border-radius: 20px;
}

#district-map-svg svg {
    width: 100%;
    height: 100%;
    max-height: 550px;
}

#district-map-svg g path {
    transition: all 0.3s ease;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 0.5;
}

#district-map-svg g:hover path {
    filter: brightness(1.3);
    stroke: rgba(255,255,255,0.4);
    stroke-width: 1;
}

.district-tooltip {
    position: fixed;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 14px;
    color: var(--text-light);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: none;
    min-width: 180px;
}

.district-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mini-stat-item {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.mini-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.city-analysis-card:hover {
    transform: translateY(-6px) scale(1.02);
    background: var(--bg-card) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.btn-jump-district {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25);
}

.btn-jump-district:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.btn-op-detail-mini {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-op-detail-mini:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-light);
    transform: translateY(-2px);
}

.district-section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.city-summary-stats-bar {
    display: none; /* JS ile açılır */
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: var(--bg-soft);
    padding: 0.8rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.city-stat-item {
    text-align: center;
    min-width: 70px;
}

.stat-item-label {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 2px;
    white-space: nowrap;
}

.stat-item-val {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-light);
}

.stat-item-val.ac-color { color: var(--primary-color); }
.stat-item-val.dc-color { color: #f59e0b; }
.stat-item-val.fast-color { color: #ef4444; }

.city-stat-divider {
    width: 1px;
    height: 25px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.city-selector-group {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
}

.table-responsive thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* style.css'teki --bg-soft standardiyla uyumlu */
.table-responsive thead th,
.table-responsive .premium-table thead th {
    white-space: nowrap;
    background: var(--bg-soft) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

/* Sadece th'ler nowrap — td'ler sarabilir, bu layout'u bozmaz */
.table-responsive tbody td {
    white-space: normal;
    word-break: break-word;
}

/* Scrollbar stil — kaldırmıyoruz, gizli değil ince yapıyoruz */
.table-responsive::-webkit-scrollbar {
    height: 4px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 10px;
}

.selector-label {
    font-size: 0.85rem;
    font-weight: 850;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.district-table-wrapper {
    transition: padding 0.3s ease;
}

@media (max-width: 1200px) {
    .district-section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .city-summary-stats-bar {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }
    .city-selector-group {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    #district-analysis-section {
        padding: 1.5rem !important;
    }
    .district-map-card {
        min-height: 400px;
        padding: 1rem;
    }
    .city-summary-stats-bar {
        padding: 1rem;
        gap: 0.8rem;
    }
    .city-stat-divider {
        display: none;
    }
    .stat-item-val {
        font-size: 1.1rem;
    }
    .district-section-header h3 {
        font-size: 1.3rem;
    }
    #district-map-legend {
        bottom: 10px;
        padding: 8px 15px;
        gap: 0.8rem;
        width: 90%;
    }
}

@media (max-width: 640px) {
    .selector-label {
        display: none;
    }
    .city-selector-group {
        flex-direction: column;
        gap: 10px;
    }
    .city-select-box {
        width: 100%;
        min-width: 100%;
        text-align: center;
    }
    .city-summary-stats-bar {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 20px;
    }
    
    .district-table-wrapper {
        padding: 15px !important;
    }
    /* Dividers are hidden via display:none in 768px, so we just grid the items */
    .city-stat-item:last-child {
        grid-column: span 2;
        border-top: 1px solid rgba(255,255,255,0.05);
        padding-top: 8px;
    }
    
    #district-map-legend {
        padding: 6px 12px;
        gap: 0.5rem;
    }
    #district-map-legend span:last-child {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    #district-analysis-section {
        padding: 1rem !important;
    }
    .district-section-header h3 {
        font-size: 1.2rem !important;
    }
    .district-map-card {
        min-height: 320px;
    }
    .stat-item-val {
        font-size: 1rem;
    }
    .city-stat-item {
        min-width: 60px;
    }
    #district-map-legend {
        width: 95%;
        border-radius: 12px;
    }
    #district-map-legend > div {
        gap: 4px;
    }
    #district-map-legend span:nth-child(1) {
        width: 10px;
        height: 10px;
    }
}

@keyframes ring-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* Analiz Sayfası Logo Responsive Fix */
.brand-logo-container, 
.op-logo-container,
.brand-box img,
.efficiency-logo {
    flex-shrink: 0 !important;
}

img[src*="get_operator_logo"] {
    object-fit: contain !important;
}
