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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0e27;
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    position: relative;
}

#topBar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    padding: 12px 15px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    position: relative;
    width: 100%;
}

#topBar h1 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #60a5fa;
}

#topBar p {
    font-size: 11px;
    margin: 0;
    line-height: 1.4;
}

#mapContainer {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
    width: 100%;
    /* BottomBar yüksekliği kadar alt padding */
    padding-bottom: 60px;
}

#map {
    width: 100%;
    height: 100%;
    background: #0a0e27;
}

#bottomBar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px 15px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #aaa;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-align: center;
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    z-index: 1000;
    
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

#bottomBar a {
    color: #E30A17;
    text-decoration: none;
    font-weight: 600;
    transition: 0.25s ease;
    margin-bottom: 2px;
    font-size: 13px;
}

#bottomBar a:hover {
    color: #ff3b3b;
    text-shadow: 0 0 6px rgba(227,10,23,0.6);
}

#bottomBar p {
    margin: 0;
    color: #777;
    font-size: 11px;
}

@media (min-width: 769px) {
    #topBar {
        padding: 15px 20px;
    }
    
    #topBar h1 {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    #topBar p {
        font-size: 12px;
        line-height: 1.5;
    }

    #bottomBar {
        padding: 14px 20px;
        font-size: 14px;
        height: 70px;
    }
    
    #mapContainer {
        padding-bottom: 70px;
    }
    
    #bottomBar a {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    #bottomBar p {
        font-size: 12px;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    #bottomBar {
        position: fixed !important;
        bottom: 0 !important;
        height: 60px !important;
        display: flex !important;
    }
    
    #mapContainer {
        padding-bottom: 60px !important;
    }
}

@media (max-width: 480px) {
    #bottomBar {
        position: fixed !important;
        bottom: 0 !important;
        height: 60px !important;
        display: flex !important;
    }
    
    #mapContainer {
        padding-bottom: 60px !important;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    #bottomBar {
        height: 50px !important;
        padding: 8px 15px !important;
    }
    
    #mapContainer {
        padding-bottom: 50px !important;
    }
    
    #bottomBar a {
        font-size: 12px !important;
        margin-bottom: 1px !important;
    }
    
    #bottomBar p {
        font-size: 10px !important;
    }
}

.leaflet-container {
    background: #0a0e27;
}

#sidebar {
    position: fixed;
    right: -100vw;
    top: 0;
    width: 100vw;
    height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: hidden;
    border-left: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) {
    #sidebar {
        width: 450px;
        right: -450px;
    }
}

#sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px 15px;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.9;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.sidebar-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 30px;
}

.chart-container {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 12px;
    display: none;
    flex-shrink: 0;
}

.chart-container.visible {
    display: block;
}

.chart-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.refresh-indicator {
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pulse {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

canvas {
    width: 100%;
    height: 150px;
    border-radius: 8px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 12px;
    flex-shrink: 0;
}

.spinner {
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

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

.station-info-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 12px;
    flex-shrink: 0;
}

.station-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.station-code {
    font-size: 16px;
    font-weight: 600;
    color: #60a5fa;
}

.station-time {
    font-size: 11px;
    color: #94a3b8;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.info-item {
    background: rgba(15, 23, 42, 0.4);
    padding: 6px;
    border-radius: 6px;
}

.info-item-label {
    font-size: 9px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-item-value {
    font-size: 11px;
    color: #fff;
    font-weight: 500;
}

.channel-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.channel-btn {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.channel-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.channel-btn:hover:not(.active) {
    background: rgba(71, 85, 105, 0.7);
    border-color: rgba(148, 163, 184, 0.5);
}

.channel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.warning-message {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    padding: 8px;
    color: #fbbf24;
    font-size: 10px;
    display: flex;
    align-items: start;
    gap: 6px;
    flex-shrink: 0;
}

.warning-icon {
    font-size: 12px;
    margin-top: 1px;
}

.info-message {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 8px;
    color: #60a5fa;
    font-size: 10px;
    flex-shrink: 0;
}

.no-channels {
    text-align: center;
    padding: 12px;
    color: #94a3b8;
    font-size: 11px;
    flex-shrink: 0;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: #fca5a5;
    font-size: 11px;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .sidebar-header {
        padding: 25px;
    }

    .sidebar-header h2 {
        font-size: 20px;
    }

    .sidebar-header p {
        font-size: 13px;
    }

    .sidebar-content {
        padding: 25px;
        padding-bottom: 30px;
        gap: 15px;
    }

    .chart-container {
        padding: 20px;
    }

    .chart-title {
        font-size: 14px;
        margin-bottom: 15px;
    }

    canvas {
        height: 200px;
    }

    .loading {
        padding: 40px;
        font-size: 13px;
    }

    .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
        margin-bottom: 15px;
    }

    .station-info-card {
        padding: 20px;
    }

    .station-meta {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .station-code {
        font-size: 18px;
    }

    .station-time {
        font-size: 13px;
    }

    .info-grid {
        gap: 12px;
    }

    .info-item {
        padding: 10px;
    }

    .info-item-label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .info-item-value {
        font-size: 14px;
    }

    .channel-selector {
        gap: 8px;
    }

    .channel-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 60px;
    }

    .warning-message {
        padding: 12px;
        font-size: 12px;
    }

    .warning-icon {
        font-size: 16px;
    }

    .info-message {
        padding: 12px;
        font-size: 12px;
    }

    .no-channels {
        padding: 20px;
        font-size: 13px;
    }

    .error-message {
        padding: 15px;
        font-size: 13px;
    }
}

.status-bar {
    position: fixed;
    bottom: 70px;
    left: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    z-index: 999;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

@media (min-width: 769px) {
    .status-bar {
        bottom: 90px;
        left: 20px;
        right: auto;
        font-size: 13px;
        padding: 12px 20px;
        text-align: left;
    }
}

.station-marker {
    background: #3b82f6;
    border: 2px solid white;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    cursor: pointer;
    transition: all 0.3s;
}

.station-marker:hover {
    transform: scale(1.5);
    box-shadow: 0 0 15px rgba(59, 130, 246, 1);
}

.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.95);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
}

.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.95);
}

#helicorderModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

#helicorderModal.open {
    display: flex;
}

.helicorder-content {
    width: 95%;
    height: 95%;
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1323 100%);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.helicorder-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.helicorder-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.helicorder-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-input {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.helicorder-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

#helicorderPlot {
    width: 100%;
    height: 100%;
    min-height: 1200px;
}

.helicorder-canvas {
    width: 100%;
    background: #0f1729;
    border-radius: 8px;
    margin-bottom: 5px;
    display: block;
}

.hour-label {
    color: #94a3b8;
    font-size: 11px;
    font-family: monospace;
    margin-left: 8px;
    margin-bottom: 8px;
}

.helicorder-loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 13px;
}

@media (min-width: 769px) {
    .helicorder-content {
        width: 90%;
        height: 90%;
    }

    .helicorder-header {
        padding: 20px 30px;
    }

    .helicorder-title {
        font-size: 20px;
    }

    .helicorder-controls {
        gap: 15px;
    }

    .date-input {
        padding: 8px 12px;
        font-size: 14px;
    }

    .helicorder-body {
        padding: 20px;
    }

    #helicorderPlot {
        min-height: 1400px;
    }
}

/* Türk bayrağı kırmızısı için hex: #E30A17 */
.flag-red { color: #E30A17; font-weight: bold; }

.gold-text {
    color: #E6B800;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
    font-weight: 500;
}

@supports(padding: max(0px)) {
    #bottomBar {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .sidebar-content {
        padding-bottom: max(30px, env(safe-area-inset-bottom));
    }
}

body.has-fixed-bottom #bottomBar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
}

body.has-fixed-bottom #mapContainer {
    padding-bottom: 60px !important;
}

@media (min-width: 769px) {
    body.has-fixed-bottom #mapContainer {
        padding-bottom: 70px !important;
    }
}