/**
 * ============================================================================
 * DOSYA ADI: styles/main.css
 * MİMARİ KATMAN: Sunum Katmanı (Presentation Layer - Stil Şablonları)
 * UYGULANAN PRENSİP:
 *   Single Responsibility Principle (SRP - Tek Sorumluluk Prensibi):
 *   Tüm görsel tasarım, renk paleti, mobil uyumluluk (Responsive Media Queries)
 *   ve animasyon kuralları HTML yapısından ayrılarak bu merkezi CSS dosyasında
 *   toplanmıştır.
 * ============================================================================
 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Saira', sans-serif;
    background: #0f172a;
    color: #0f172a;
    overflow: hidden;
}

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

.material-symbols-outlined {
    font-size: 18px;
    vertical-align: middle;
    line-height: 1;
    display: inline-block;
}

/* Beyaz, Keskin Köşeli & Derin Gölgeli Kontrol Paneli */
.panel-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10001;
    width: 360px;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 0px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    transition: max-height 0.3s ease, box-shadow 0.3s ease;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    padding-bottom: 4px;
}

.panel-header:active {
    cursor: grabbing;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #003f78;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.toggle-icon {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #003f78;
    border-radius: 0px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 0;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 140px);
    padding-right: 4px;
    transition: all 0.3s ease;
}

#btn-calculate {
    flex-shrink: 0;
}

.panel-overlay.collapsed .panel-content {
    display: none;
}

.panel-overlay.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* Canlı Kuyruk Rozeti - Üst Orta */
.queue-badge {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #003f78;
    border-radius: 0px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #003f78;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.queue-badge.waiting {
    border-color: #d97706;
    color: #b45309;
}

.queue-badge.processing {
    border-color: #059669;
    color: #047857;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-row {
    display: flex;
    gap: 8px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0px;
    padding: 10px 12px;
    color: #0f172a;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: #003f78;
    box-shadow: 0 0 0 2px rgba(0, 63, 120, 0.15);
}

.btn {
    padding: 10px 14px;
    border-radius: 0px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Saira', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

.btn-grid-sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(80%);
}

.btn-primary,
#btn-search,
#btn-calculate {
    background: #003f78;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled),
#btn-search:hover:not(:disabled),
#btn-calculate:hover:not(:disabled) {
    background: #002c54;
}

.btn-secondary {
    background: #475569;
    color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
    background: #334155;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
    grid-column: span 2;
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.status-box {
    background: #f1f5f9;
    border-radius: 0px;
    padding: 10px;
    font-size: 12px;
    color: #334155;
    border-left: 3px solid #003f78;
    line-height: 1.4;
}

/* --- MOBİL UYUMLU RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
    .panel-overlay {
        width: calc(100vw - 24px);
        left: 12px;
        top: auto;
        bottom: 12px;
        max-height: 75vh;
        padding: 12px;
        gap: 8px;
    }

    .panel-content {
        max-height: calc(75vh - 100px);
        overflow-y: auto;
    }

    .queue-badge {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        padding: 6px 12px;
    }

    .panel-title {
        font-size: 16px;
    }

    .btn {
        padding: 10px;
        font-size: 12px;
    }
}

/* --- ÖZEL UYARI MODALI (CUSTOM NOTIFICATION MODAL) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}

.modal-card {
    background: #ffffff;
    border: 1px solid #dc2626;
    border-radius: 0px;
    width: 400px;
    max-width: 90vw;
    padding: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #0f172a;
}

.modal-body {
    font-size: 13.5px;
    color: #1e293b;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

/* CANLI GPS KONUM İŞARETÇİSİ STİLLERİ */
.user-live-location-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.user-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #2563eb;
    border: 3.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(37, 99, 235, 1.0), 0 0 0 4px rgba(37, 99, 235, 0.4);
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    width: 44px;
    height: 44px;
    background-color: rgba(59, 130, 246, 0.35);
    border: 2.5px solid #2563eb;
    border-radius: 50%;
    animation: pulse-animation 1.6s infinite ease-out;
    z-index: 1;
}

@keyframes pulse-animation {
    0% {
        transform: scale(0.3);
        opacity: 1;
    }

    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

/* LEAFLET HARİTA KATMAN SEÇİM KUTUSU KAPATMA BUTONU */
.leaflet-control-layers {
    position: relative !important;
}

.leaflet-control-layers-expanded {
    padding: 8px 30px 8px 10px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

.layer-control-close-btn {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.15s ease;
}

.layer-control-close-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.leaflet-control-layers-expanded .layer-control-close-btn {
    display: flex !important;
}

