/* ORBAY - Türkiye Yangın İstihbarat Sistemi Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow: hidden;
    /* Better touch scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

/* Header Styles */
#header {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #fef08a;
}

.logo h1 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.logo .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: normal;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-left: 10px;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    text-align: center;
    padding: 8px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 2px;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Controls Panel */
#controls {
    position: fixed;
    top: 100px;
    left: 20px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 20px;
}

.control-group {
    margin-bottom: 25px;
}

.control-group h3 {
    color: #dc2626;
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Switch Styles */
.switch {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
    margin-right: 12px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: #dc2626;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Legend Styles */
.legend {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.legend-color.critical { background-color: #dc2626; }
.legend-color.high { background-color: #f97316; }
.legend-color.medium { background-color: #eab308; }
.legend-color.low { background-color: #16a34a; }

/* Buttons */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #dc2626;
    color: white;
}

.btn-primary:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

/* Map Styles */
#map {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    bottom: 40px;
    z-index: 1;
}

/* Status Bar */
#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    color: white;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    z-index: 1000;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modal Styles */
/* Marker Cluster Styles */
.marker-cluster {
    background-color: rgba(220, 38, 38, 0.8) !important;
    border: 2px solid rgba(220, 38, 38, 1) !important;
    border-radius: 50% !important;
    color: white !important;
    font-weight: bold !important;
    text-align: center !important;
    font-size: 12px !important;
}

.marker-cluster div {
    background-color: rgba(220, 38, 38, 0.9) !important;
    border-radius: 50% !important;
    width: 26px !important;
    height: 26px !important;
    margin: 2px !important;
}

.marker-cluster span {
    line-height: 26px !important;
    display: block !important;
}

.marker-cluster-small {
    background-color: rgba(251, 191, 36, 0.8) !important;
    border-color: rgba(251, 191, 36, 1) !important;
}

.marker-cluster-small div {
    background-color: rgba(251, 191, 36, 0.9) !important;
}

.marker-cluster-medium {
    background-color: rgba(249, 115, 22, 0.8) !important;
    border-color: rgba(249, 115, 22, 1) !important;
}

.marker-cluster-medium div {
    background-color: rgba(249, 115, 22, 0.9) !important;
}

.marker-cluster-large {
    background-color: rgba(220, 38, 38, 0.8) !important;
    border-color: rgba(220, 38, 38, 1) !important;
}

.marker-cluster-large div {
    background-color: rgba(220, 38, 38, 0.9) !important;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.close:hover {
    color: #dc2626;
}

/* Fire Detail Styles */
.fire-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Province selector styles */
#province-selector {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

#province-selector:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.info-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
}

.info-section h4 {
    color: #dc2626;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.info-label {
    font-weight: 600;
    color: #4b5563;
}

.info-value {
    color: #1f2937;
}

.risk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.risk-critical { background: #fecaca; color: #dc2626; }
.risk-high { background: #fed7aa; color: #f97316; }
.risk-medium { background: #fef3c7; color: #eab308; }
.risk-low { background: #dcfce7; color: #16a34a; }

/* Responsive Design */
@media (max-width: 768px) {
    #controls {
        position: fixed;
        top: auto;
        bottom: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 300px;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    #controls.open {
        transform: translateY(0);
    }
    
    .header-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-box {
        padding: 6px 10px;
    }
    
    .fire-info {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

/* Dark Mode */
body.dark-mode {
    background: #1f2937;
    color: #f9fafb;
}

body.dark-mode #controls {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .legend {
    background: #4b5563;
    border-color: #6b7280;
}

body.dark-mode .info-section {
    background: #4b5563;
}

body.dark-mode .modal-content {
    background: #374151;
    color: #f9fafb;
}

/* Custom Leaflet Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}


.leaflet-popup-content {
    margin: 15px;
    line-height: 1.4;
}

.popup-title {
    font-weight: bold;
    color: #dc2626;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.popup-info {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.popup-info strong {
    color: #4b5563;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Desktop: Hide mobile menu toggle */
.mobile-menu-toggle {
    display: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* Header Optimizations */
    #header {
        padding: 10px 15px;
    }
    
    .logo {
        gap: 10px;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .logo .subtitle {
        font-size: 0.8rem;
    }
    
    .header-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
        min-width: 240px;
    }
    
    .stat-item {
        font-size: 0.8rem;
        padding: 2px 0;
    }
    
    /* Main Content Layout */
    #main-content {
        flex-direction: column;
    }
    
    /* Sidebar as collapsible mobile menu */
    #controls {
        position: fixed;
        top: 70px;
        left: -320px;
        width: 300px;
        height: calc(100vh - 70px);
        z-index: 2000;
        transition: left 0.3s ease;
        border-radius: 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        overflow-y: auto;
    }
    
    #controls.mobile-open {
        left: 0;
    }
    
    /* Mobile Menu Toggle Button */
    .mobile-menu-toggle {
        display: block;
        background: rgba(255,255,255,0.2);
        border: none;
        color: white;
        font-size: 1.5rem;
        padding: 8px 12px;
        border-radius: 5px;
        cursor: pointer;
        transition: background 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255,255,255,0.3);
    }
    
    /* Map takes full width */
    #map-container {
        width: 100%;
        height: calc(100vh - 70px);
    }
    
    #map {
        height: 100%;
    }
    
    /* Control Panels */
    .control-panel {
        margin-bottom: 15px;
    }
    
    .control-panel h3 {
        font-size: 1rem;
        padding: 8px 10px;
    }
    
    .control-item {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    /* Checkboxes and inputs */
    .control-item input[type="checkbox"] {
        transform: scale(1.2);
        margin-right: 8px;
    }
    
    .control-item select {
        padding: 6px;
        font-size: 0.9rem;
    }
    
    /* Fire popup optimizations */
    .leaflet-popup-content {
        margin: 10px 8px;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .popup-header {
        padding: 8px 0;
    }
    
    .popup-info {
        gap: 8px;
    }
    
    /* Touch-friendly buttons */
    button, .btn {
        min-height: 44px;
        padding: 10px 15px;
        font-size: 1rem;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        touch-action: manipulation;
    }
    
    /* Overlay for mobile menu */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1500;
    }
    
    .mobile-overlay.active {
        display: block;
    }
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    #controls {
        width: 280px;
    }
    
    #map-container {
        width: calc(100% - 280px);
    }
    
    .control-item {
        font-size: 0.95rem;
    }
}

/* Large mobile devices */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    #controls {
        width: 280px;
        left: -280px;
    }
    
    .header-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
        min-width: 220px;
    }
    
    .stat-item {
        font-size: 0.7rem;
    }
}

/* Intro Animation Styles */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1s ease-out;
    overflow: hidden;
}

.intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 100000;
}

.turkish-flag {
    width: 80px;
    height: 53px;
    margin-bottom: 25px;
    animation: flagWave 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 15px rgba(255,255,255,0.2));
}

.intro-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: #dc2626;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 8px;
    animation: titleGlow 3s ease-in-out infinite alternate;
    letter-spacing: 1px;
}

.intro-subtitle {
    font-size: 1.1rem;
    color: #f3f4f6;
    margin-bottom: 30px;
    opacity: 0.9;
    font-weight: 300;
}

.developer-credit {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    color: #f3f4f6;
    font-weight: 500;
    z-index: 100001;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    animation: developerGlow 4s ease-in-out infinite alternate;
    letter-spacing: 0.5px;
}

.loading-container {
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100001;
}

.loading-text {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: rgba(156, 163, 175, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #f97316, #dc2626);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: loadingProgress 3s infinite;
}

@keyframes flagWave {
    0%, 100% {
        transform: rotateY(0deg) scale(1);
    }
    50% {
        transform: rotateY(10deg) scale(1.05);
    }
}

@keyframes titleGlow {
    0% {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 20px rgba(220, 38, 38, 0.5);
    }
    100% {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 30px rgba(220, 38, 38, 0.8);
    }
}

@keyframes developerGlow {
    0% {
        color: #f3f4f6;
        text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 15px rgba(59, 130, 246, 0.3);
    }
    100% {
        color: #fbbf24;
        text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 25px rgba(251, 191, 36, 0.6);
    }
}

@keyframes loadingProgress {
    0% {
        transform: translateX(-100%);
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        transform: translateX(200%);
        background-position: 0% 50%;
    }
}

/* Mobile intro responsive */
@media (max-width: 768px) {
    .intro-title {
        font-size: 1.8rem;
    }
    
    .intro-subtitle {
        font-size: 0.95rem;
    }
    
    .turkish-flag {
        width: 70px;
        height: 47px;
        margin-bottom: 20px;
    }
    
    .developer-credit {
        font-size: 0.95rem;
        bottom: 300px;
        z-index: 100002;
    }
    
    .loading-container {
        bottom: 230px;
        z-index: 100002;
    }
    
    .loading-bar {
        width: 150px;
    }
    
    .loading-text {
        font-size: 0.85rem;
        color: #e5e7eb;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .intro-title {
        font-size: 1.5rem;
    }
    
    .intro-subtitle {
        font-size: 0.85rem;
    }
    
    .turkish-flag {
        width: 60px;
        height: 40px;
        margin-bottom: 15px;
    }
    
    .developer-credit {
        font-size: 0.85rem;
        bottom: 280px;
        z-index: 100002;
    }
    
    .loading-container {
        bottom: 210px;
        z-index: 100002;
    }
    
    .loading-bar {
        width: 120px;
    }
    
    .loading-text {
        font-size: 0.8rem;
        color: #e5e7eb;
        opacity: 1;
    }
}