/* ========================================
   PROFESYONEL RADAR TAKIP SİSTEMİ - CSS
   ======================================== */

:root {
    /* Renkler */
    --primary: #0f172a;
    --secondary: #1e293b;
    --tertiary: #334155;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark-text: #f8fafc;
    --light-text: #94a3b8;
    
    /* Boyutlar */
    --panel-width: 380px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Syne', sans-serif;
    background: var(--primary);
    color: var(--dark-text);
    overflow: hidden;
}

/* ========================================
   ANA LAYOUT
   ======================================== */

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.left-panel {
    width: var(--panel-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    border-right: 1px solid var(--tertiary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.left-panel::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-track {
    background: transparent;
}

.left-panel::-webkit-scrollbar-thumb {
    background: var(--tertiary);
    border-radius: 3px;
}

.left-panel::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.left-panel.collapsed {
    width: 0;
    border-right: none;
}

.map-container {
    flex: 1;
    position: relative;
    background: var(--primary);
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ========================================
   PANEL BAŞLIĞI
   ======================================== */

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.radar-animation {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 50% 50%, var(--accent), transparent);
    border-radius: 50%;
    position: relative;
    animation: radarSweep 3s linear infinite;
}

.radar-animation::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--accent);
}

@keyframes radarSweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.panel-header h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.btn-toggle-panel {
    background: var(--tertiary);
    border: none;
    color: var(--dark-text);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
}

.btn-toggle-panel:hover {
    background: var(--accent);
    color: var(--primary);
}

/* ========================================
   DASHBOARD KART
   ======================================== */

.dashboard-card {
    padding: 16px;
    margin: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--tertiary);
    border-radius: var(--border-radius);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tertiary);
}

.live-indicator {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--success), inset 0 0 4px rgba(255, 255, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

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

.status-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--success);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    background: rgba(60, 130, 245, 0.05);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(60, 130, 245, 0.2);
}

.stat-label {
    font-size: 11px;
    color: var(--light-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-light);
    font-family: 'Courier Prime', monospace;
}

/* ========================================
   ARAMA BÖLÜMÜ
   ======================================== */

.search-section {
    padding: 0 16px 16px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container i {
    position: absolute;
    left: 12px;
    color: var(--light-text);
    font-size: 14px;
    pointer-events: none;
}

#search-input {
    width: 100%;
    background: var(--tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
    padding: 10px 12px 10px 36px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Courier Prime', monospace;
    transition: var(--transition);
}

#search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(60, 130, 245, 0.1);
    box-shadow: 0 0 12px rgba(60, 130, 245, 0.3);
}

#search-input::placeholder {
    color: var(--light-text);
}

/* ========================================
   FİLTRELER
   ======================================== */

.filters-section {
    padding: 0 16px 16px;
}

.filter-toggle {
    width: 100%;
    background: rgba(249, 158, 11, 0.1);
    border: 1px solid rgba(249, 158, 11, 0.3);
    color: var(--dark-text);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.filter-toggle:hover {
    background: rgba(249, 158, 11, 0.2);
    border-color: rgba(249, 158, 11, 0.5);
}

.filter-count {
    background: var(--warning);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.filter-count.hidden {
    display: none;
}

.filters-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filters-content.open {
    max-height: 400px;
}

.filter-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--tertiary);
}

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

.filter-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--light-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.filter-inputs {
    display: flex;
    gap: 8px;
}

.filter-inputs input {
    flex: 1;
    background: var(--tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier Prime', monospace;
}

.filter-inputs input:focus {
    outline: none;
    border-color: var(--accent);
}

.type-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.type-filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    color: var(--dark-text);
    cursor: pointer;
    background: var(--tertiary);
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.type-filters label:hover {
    background: rgba(60, 130, 245, 0.2);
}

.type-filters input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

#airline-filter {
    width: 100%;
    background: var(--tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

#airline-filter:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-apply-filters, .btn-reset-filters {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-apply-filters {
    background: var(--accent);
    color: var(--primary);
}

.btn-apply-filters:hover {
    background: var(--accent-light);
}

.btn-reset-filters {
    background: var(--tertiary);
    color: var(--dark-text);
}

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

/* ========================================
   LİSTE GÖRÜNÜMÜ
   ======================================== */

.list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    min-height: 200px;
}

.list-toggle {
    width: 100%;
    background: var(--secondary);
    border: 1px solid var(--tertiary);
    color: var(--dark-text);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.list-toggle:hover {
    background: var(--tertiary);
}

.aircraft-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aircraft-list::-webkit-scrollbar {
    width: 6px;
}

.aircraft-list::-webkit-scrollbar-thumb {
    background: var(--tertiary);
    border-radius: 3px;
}

.aircraft-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.list-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--light-text);
    text-align: center;
}

.list-placeholder i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.list-placeholder p {
    font-size: 12px;
}

.aircraft-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--tertiary);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.aircraft-item:hover {
    background: rgba(60, 130, 245, 0.15);
    border-color: var(--accent);
    transform: translateX(4px);
}

.aircraft-item.active {
    background: rgba(60, 130, 245, 0.25);
    border-color: var(--accent);
    box-shadow: inset 0 0 12px rgba(60, 130, 245, 0.2);
}

.aircraft-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aircraft-item-icon svg {
    width: 100%;
    height: 100%;
}

.aircraft-item-info {
    flex: 1;
    min-width: 0;
}

.aircraft-item-callsign {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-light);
    font-family: 'Courier Prime', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aircraft-item-details {
    font-size: 11px;
    color: var(--light-text);
    display: flex;
    gap: 8px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   HARITA KONTROLLERİ
   ======================================== */

.map-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid var(--tertiary);
}

.map-controls button {
    width: 100%;
    background: var(--secondary);
    border: 1px solid var(--tertiary);
    color: var(--dark-text);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-controls button:hover {
    background: var(--tertiary);
}

.map-controls button.active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* ========================================
   TEMA SEÇENEĞI
   ======================================== */

.theme-toggle {
    padding: 0 16px 16px;
}

.theme-toggle button {
    width: 100%;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--dark-text);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.theme-toggle button:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
}

/* ========================================
   HARITA ÜZERİ BİLGİLER
   ======================================== */

.map-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
}

.info-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    font-family: 'Courier Prime', monospace;
    display: flex;
    gap: 8px;
}

.info-label {
    color: var(--light-text);
}

.info-value {
    color: var(--accent-light);
    font-weight: 700;
}

/* ========================================
   DETAY MODAL
   ======================================== */

.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.detail-modal.open {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.detail-modal.open .detail-content {
    animation: slideUp 0.3s ease;
}

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

.detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--secondary);
    border: 1px solid var(--tertiary);
    color: var(--dark-text);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: var(--transition);
    z-index: 1001;
}

.detail-close:hover {
    background: var(--tertiary);
    transform: rotate(90deg);
}

.detail-content {
    background: var(--secondary);
    border: 1px solid var(--tertiary);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.detail-content::-webkit-scrollbar {
    width: 6px;
}

.detail-content::-webkit-scrollbar-thumb {
    background: var(--tertiary);
    border-radius: 3px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tertiary);
}

.detail-title i {
    font-size: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--light-text);
    font-weight: 600;
}

.detail-value {
    color: var(--dark-text);
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
}

.detail-value.highlight {
    color: var(--accent-light);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tertiary);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--light-text);
    font-size: 13px;
}

/* ========================================
   TOAST BİLDİRİMLER
   ======================================== */

#toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--secondary);
    border: 1px solid var(--tertiary);
    color: var(--dark-text);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: toastSlide 0.3s ease;
    pointer-events: auto;
}

@keyframes toastSlide {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: var(--success);
}

.toast.success i {
    color: var(--success);
}

.toast.warning {
    border-color: var(--warning);
}

.toast.warning i {
    color: var(--warning);
}

.toast.error {
    border-color: var(--danger);
}

.toast.error i {
    color: var(--danger);
}

/* ========================================
   LEAFLET CUSTOMIZATION
   ======================================== */

.plane-icon {
    background: transparent;
    border: none;
    transition: transform 0.3s ease;
}

.plane-icon:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 8px var(--accent));
}

.leaflet-popup-content-wrapper {
    background: var(--secondary);
    color: var(--dark-text);
    border: 1px solid var(--tertiary);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-tip {
    background: var(--secondary);
}

.leaflet-popup-content {
    margin: 12px;
    line-height: 1.6;
    font-family: 'Courier Prime', monospace;
}

.popup-title {
    color: var(--accent-light);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--tertiary);
    padding-bottom: 8px;
}

.popup-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    gap: 15px;
    margin-bottom: 4px;
}

.popup-label {
    color: var(--light-text);
    font-weight: 600;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    :root {
        --panel-width: 100%;
    }

    .app-container {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--tertiary);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

    .left-panel.collapsed {
        height: 0;
        max-height: 0;
    }

    .map-container {
        flex: 1;
        min-height: 50vh;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .filters-content.open {
        max-height: 600px;
    }

    .detail-content {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .panel-header {
        padding: 16px;
    }

    .dashboard-card {
        padding: 12px;
        margin: 12px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .detail-content {
        padding: 20px;
    }

    .map-info {
        bottom: 10px;
        right: 10px;
        gap: 6px;
    }

    .info-card {
        padding: 6px 10px;
        font-size: 10px;
    }
}

/* ========================================
   DARK THEME (DEFAULT)
   ======================================== */

body.dark-theme {
    --primary: #0f172a;
    --secondary: #1e293b;
    --tertiary: #334155;
    --dark-text: #f8fafc;
    --light-text: #94a3b8;
}

/* ========================================
   LIGHT THEME (OPTIONAL)
   ======================================== */

body.light-theme {
    --primary: #f8fafc;
    --secondary: #e2e8f0;
    --tertiary: #cbd5e1;
    --dark-text: #0f172a;
    --light-text: #475569;
}

body.light-theme .left-panel {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}

body.light-theme .dashboard-card {
    background: rgba(255, 255, 255, 0.4);
}

body.light-theme #map {
    background: #ffffff;
}

body.light-theme .leaflet-popup-content-wrapper {
    background: #f1f5f9;
}

body.light-theme .leaflet-popup-tip {
    background: #f1f5f9;
}