/* ========================================
   İMSAKİYE V2 - GELİŞMİŞ NAVİGASYON VE KONTROLLER
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Cairo:wght@300;400;600;700&family=Amiri:wght@400;700&display=swap');

:root {
    --primary-gold: #D4AF37;
    --secondary-gold: #FFD700;
    --deep-blue: #0A1628;
    --space-blue: #1A2F4F;
    --accent-teal: #00D9FF;
    --soft-white: #F5F5DC;
    --prayer-active: #00FFB3;
    --ramazan-green: #10B981;
    --kandil-gold: #FBBF24;
    --bayram-red: #EF4444;
    --mevlid-purple: #A855F7;
}

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

body {
    font-family: 'Cairo', sans-serif;
    background: radial-gradient(ellipse at top, var(--deep-blue), #000814);
    color: var(--soft-white);
    min-height: 100vh;
}

.imsakiye-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* ========================================
   BAŞLIK ÇERÇEVE TASARIMI
   ======================================== */
.imsakiye-header {
    background: rgba(26, 47, 79, 0.6);
    border: 3px solid var(--primary-gold);
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 30px;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.imsakiye-header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, transparent, var(--accent-teal), transparent);
}

.main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-gold), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.main-title .icon {
    display: inline-block;
    margin-right: 8px;
    -webkit-text-fill-color: var(--primary-gold);
}

.subtitle {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: var(--primary-gold);
}

/* ========================================
   MOBİL NAVİGASYON TAŞMA DÜZELTMESİ
   ======================================== */
.month-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap; /* Mobilde butonların alta düşmesini sağlar */
}

.nav-btn {
    background: rgba(26, 47, 79, 0.8);
    border: 2px solid var(--accent-teal);
    color: var(--soft-white);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: var(--accent-teal);
    color: var(--deep-blue);
    box-shadow: 0 0 15px var(--accent-teal);
}

.current-month-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--primary-gold);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    min-width: 180px;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
}

@media (max-width: 480px) {
    .month-navigation { 
        gap: 10px; 
        margin: 15px 0;
    }
    .nav-btn { 
        padding: 8px 12px; 
        font-size: 0.8rem; 
        flex: 1; /* Butonların eşit genişlikte sığmasını sağlar */
        justify-content: center;
    }
    .current-month-display { 
        width: 100%; 
        order: -1; /* Ay ismini en üste alır */
        font-size: 1rem;
        margin-bottom: 10px;
    }
}

/* ========================================
   CONTROLS - KOMPAKT
   ======================================== */
.controls-section {
    background: rgba(26, 47, 79, 0.8);
    border: 2px solid var(--primary-gold);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.location-control {
    grid-column: 1 / -1;
}

.divider-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--accent-teal);
    font-size: 0.85rem;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--primary-gold);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.styled-select, .action-btn {
    width: 100%;
    padding: 10px 12px;
    background: rgba(10, 22, 40, 0.9);
    color: var(--soft-white);
    border: 2px solid var(--accent-teal);
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.styled-select:hover, .action-btn:hover {
    border-color: var(--primary-gold);
}

.styled-select:focus {
    outline: none;
    border-color: var(--prayer-active);
}

.styled-select option {
    background: var(--deep-blue);
}

.location-btn {
    background: linear-gradient(135deg, var(--ramazan-green), #059669);
    border-color: var(--ramazan-green);
    font-weight: 700;
    text-transform: uppercase;
}

.action-buttons {
    display: none;
}

.location-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}

/* ========================================
   MANUEL SEÇİM PANELİ (AÇILIR-KAPANIR)
   ======================================== */
.manual-selection-wrapper {
    margin-bottom: 20px;
}

.toggle-manual-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--space-blue), var(--deep-blue));
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.toggle-manual-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

.toggle-manual-btn.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.manual-controls-content {
    display: none; /* Varsayılan kapalı */
    background: rgba(26, 47, 79, 0.9);
    border: 2px solid var(--primary-gold);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 20px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.manual-controls-content.show {
    display: grid;
}

/* ========================================
   DİNİ GÜNLER - ÜST PANEL
   ======================================== */
.islamic-events-alert {
    background: linear-gradient(135deg, 
        rgba(212, 175, 55, 0.3), 
        rgba(168, 85, 247, 0.3)
    );
    border: 4px solid var(--primary-gold);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 
        0 15px 50px rgba(212, 175, 55, 0.6),
        0 0 60px rgba(168, 85, 247, 0.4);
    animation: event-glow 3s ease-in-out infinite;
}

@keyframes event-glow {
    0%, 100% { 
        box-shadow: 
            0 15px 50px rgba(212, 175, 55, 0.6),
            0 0 60px rgba(168, 85, 247, 0.4);
    }
    50% { 
        box-shadow: 
            0 15px 70px rgba(212, 175, 55, 0.9),
            0 0 80px rgba(168, 85, 247, 0.7);
    }
}

.islamic-events-alert h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-gold);
    font-size: 1.6rem;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 20px var(--primary-gold);
}

.events-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.event-badge {
    padding: 18px 30px;
    border-radius: 15px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    border: 4px solid;
    transition: all 0.3s;
    cursor: pointer;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-badge:hover {
    transform: translateY(-5px) scale(1.08);
}

.event-badge.ramazan {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.5), rgba(5, 150, 105, 0.5));
    border-color: var(--ramazan-green);
    color: white;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.8);
}

.event-badge.bayram {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), rgba(220, 38, 38, 0.5));
    border-color: var(--bayram-red);
    color: white;
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.8);
}

.event-badge.kandil {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.5), rgba(245, 158, 11, 0.5));
    border-color: var(--kandil-gold);
    color: white;
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.8);
}

.event-badge.mevlid {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.5), rgba(147, 51, 234, 0.5));
    border-color: var(--mevlid-purple);
    color: white;
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.8);
}

.event-badge.special, .event-badge.ozel {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.5), rgba(64, 224, 208, 0.5));
    border-color: var(--accent-teal);
    color: white;
    box-shadow: 0 10px 40px rgba(0, 217, 255, 0.8);
}

/* ========================================
   TABLO - BÜYÜK SAATLER
   ======================================== */
.imsakiye-table-wrapper {
    overflow-x: auto;
    margin-bottom: 25px;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

.imsakiye-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(26, 47, 79, 0.5);
}

.imsakiye-table thead {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(0, 217, 255, 0.25));
    position: sticky;
    top: 0;
    z-index: 10;
}

.imsakiye-table th {
    padding: 10px 6px;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.prayer-header {
    color: var(--primary-gold);
    font-size: 0.9rem;
}

.prayer-col {
    color: var(--accent-teal);
}

.prayer-icon {
    font-size: 1.3rem;
    display: block;
    margin-bottom: 3px;
}

.imsakiye-table td {
    padding: 10px 6px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.date-col {
    font-weight: 700;
    color: var(--primary-gold);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
}

.day-col {
    font-weight: 600;
    color: var(--accent-teal);
    font-size: 0.95rem;
}

.time-cell {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    color: var(--soft-white);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* SATIR STİLLERİ */
.imsakiye-table tbody tr {
    transition: all 0.2s;
}

.imsakiye-table tbody tr:hover {
    background: rgba(0, 217, 255, 0.1);
}

/* Bugün - Yeşil */
.today-row {
    background: rgba(16, 185, 129, 0.25) !important;
    border-left: 5px solid var(--ramazan-green) !important;
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.3);
}

.today-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 10px;
    background: var(--ramazan-green);
    color: white;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Cuma - Altın */
.friday-row {
    background: rgba(251, 191, 36, 0.15) !important;
    border-left: 3px solid var(--kandil-gold) !important;
}

/* ========================================
   ÖZEL GÜN RENK VE ETİKETLERİ
   ======================================== */

/* ÖZEL GÜNLER - ÇOK ÇOK BELİRGİN */
.special-day-row {
    background: linear-gradient(90deg, 
        rgba(239, 68, 68, 0.3),
        rgba(251, 191, 36, 0.3),
        rgba(168, 85, 247, 0.3),
        rgba(251, 191, 36, 0.3),
        rgba(239, 68, 68, 0.3)
    ) !important;
    border-left: 6px solid var(--bayram-red) !important;
    border-right: 6px solid var(--mevlid-purple) !important;
    box-shadow: 
        inset 0 0 30px rgba(168, 85, 247, 0.4),
        0 0 40px rgba(239, 68, 68, 0.5);
    animation: special-glow 2s ease-in-out infinite;
}

@keyframes special-glow {
    0%, 100% { box-shadow: inset 0 0 30px rgba(168, 85, 247, 0.4), 0 0 40px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: inset 0 0 50px rgba(168, 85, 247, 0.7), 0 0 60px rgba(239, 68, 68, 0.8); }
}

/* Kandil Geceleri - Altın Vurgu */
.special-day-kandil {
    background: rgba(251, 191, 36, 0.15) !important;
    border-left: 5px solid var(--kandil-gold) !important;
}
.special-day-kandil .special-day-label {
    background: var(--kandil-gold) !important;
    color: #000 !important;
}

/* Bayramlar - Kırmızı Vurgu */
.special-day-bayram {
    background: rgba(239, 68, 68, 0.15) !important;
    border-left: 5px solid var(--bayram-red) !important;
}

/* Ramazan Başlangıcı - Yeşil Vurgu */
.special-day-ramazan {
    background: rgba(16, 185, 129, 0.15) !important;
    border-left: 5px solid var(--ramazan-green) !important;
}
.special-day-ramazan .special-day-label {
    background: var(--ramazan-green) !important;
}

/* TABLO İÇİ ÖZEL GÜN ETİKETLERİ */
.special-day-label {
    display: block;
    font-size: 0.8rem;
    color: white;
    background: var(--bayram-red);
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.6);
}

/* Ramazan Günü Sayacı için özel stil */
.ramazan-count {
    background: var(--ramazan-green) !important;
    font-size: 0.7rem;
}

/* ========================================
   MOBİL - 2 SATIR
   ======================================== */
@media (max-width: 767px) {
    .imsakiye-container {
        padding: 15px 10px;
    }
    
    .main-title {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .controls-section {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .islamic-events-alert h3 {
        font-size: 1.2rem;
    }
    
    .event-badge {
        font-size: 0.9rem;
        padding: 12px 20px;
        min-width: 160px;
    }
    
    /* TABLO - 2 SATIR LAYOUT */
    .imsakiye-table {
        display: block;
    }
    
    .imsakiye-table thead {
        display: none;
    }
    
    .imsakiye-table tbody {
        display: block;
    }
    
    .imsakiye-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
        padding: 12px;
        background: rgba(26, 47, 79, 0.7);
        border-radius: 12px;
        border: 2px solid rgba(212, 175, 55, 0.3);
        position: relative;
        overflow: hidden;
    }

    /* Mobilde Satır Vurguları */
    .today-row {
        border: 2px solid var(--ramazan-green) !important;
        background: rgba(16, 185, 129, 0.2) !important;
    }
    
    .friday-row {
        border: 2px solid var(--kandil-gold) !important;
        background: rgba(251, 191, 36, 0.15) !important;
    }
    
    .special-day-row {
        border: 2px solid var(--bayram-red) !important;
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(168, 85, 247, 0.2)) !important;
    }
    
    /* Mobilde Özel Gün Stilleri */
    .special-day-kandil {
        border: 2px solid var(--kandil-gold) !important;
        background: rgba(251, 191, 36, 0.15) !important;
    }
    
    .special-day-bayram {
        border: 2px solid var(--bayram-red) !important;
        background: rgba(239, 68, 68, 0.15) !important;
    }
    
    .special-day-ramazan {
        border: 2px solid var(--ramazan-green) !important;
        background: rgba(16, 185, 129, 0.15) !important;
    }
    
    .date-col {
        grid-column: 1;
        grid-row: 1;
        text-align: left;
        padding: 0;
        font-size: 0.95rem;
    }
    
    .day-col {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
        padding: 0;
        font-size: 0.95rem;
    }
    
    .time-cell {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 10px 6px;
        background: rgba(0, 217, 255, 0.1);
        border-radius: 8px;
        border: 1px solid rgba(0, 217, 255, 0.3);
        font-size: 1.1rem;
    }
    
    .time-cell:nth-child(3) { grid-column: 1; grid-row: 2; }
    .time-cell:nth-child(4) { grid-column: 2; grid-row: 2; }
    .time-cell:nth-child(5) { grid-column: 1; grid-row: 3; }
    .time-cell:nth-child(6) { grid-column: 2; grid-row: 3; }
    .time-cell:nth-child(7) { grid-column: 1; grid-row: 4; }
    .time-cell:nth-child(8) { grid-column: 2; grid-row: 4; }
    
    .time-cell::before {
        content: attr(data-prayer);
        font-size: 0.7rem;
        color: var(--accent-teal);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .special-day-label {
        grid-column: 1 / -1;
        grid-row: 5;
        text-align: center;
        margin-top: 5px;
        font-size: 0.75rem;
        width: 100%;
    }
    
    .today-badge {
        grid-column: 1 / -1;
        grid-row: 5;
        margin: 5px 0 0 0;
        display: block;
        text-align: center;
        font-size: 0.7rem;
    }
}

/* ========================================
   FOOTER
   ======================================== */
.imsakiye-footer {
    margin-top: 25px;
}

.info-box {
    padding: 18px;
    background: rgba(26, 47, 79, 0.7);
    border-radius: 12px;
    border: 2px solid var(--primary-gold);
    margin-bottom: 12px;
}

.info-box h4 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-gold);
    margin-bottom: 10px;
    font-size: 1rem;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 5px 0;
    color: var(--soft-white);
    font-size: 0.85rem;
}

.info-box li strong {
    color: var(--accent-teal);
}

.print-info {
    padding: 12px;
    background: rgba(0, 217, 255, 0.1);
    border-left: 4px solid var(--accent-teal);
    border-radius: 8px;
    font-size: 0.85rem;
}

/* ========================================
   PRINT
   ======================================== */
@media print {
    body { background: white; color: black; }
    .controls-section, .islamic-events-alert, .imsakiye-footer { display: none !important; }
    .imsakiye-table { background: white; }
    .imsakiye-table th, .imsakiye-table td { border: 1px solid black; color: black; }
}