:root {
    /* --- RENK PALETİ --- */
    --bg-body: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --bg-header: linear-gradient(135deg, #1e293b, #334155);
    --bg-card: rgba(255, 255, 255, 0.98);
    
    --text-primary: #334155;
    --text-secondary: #64748b;
    --text-white: #ffffff;
    
    --input-bg: #f8fafc;
    --border-color: #e2e8f0;
    --accent-color: #6366f1;
    
    --btn-bg: #475569;
    --btn-hover: #334155;
    
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- TEMEL AYARLAR (TAŞMAYI ÖNLER) --- */
* {
    box-sizing: border-box; /* Kritik kod: Padding taşmasını engeller */
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Yatay kaydırmayı kökten kapatır */
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-body);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    display: flex;
    justify-content: center; /* Ortala */
    align-items: flex-start;
    min-height: 100vh;
    font-size: 14px;
}

/* --- KONTEYNER (KARTLARI SARAN KUTU) --- */
.konteyner {
    width: 92%; /* Mobilde kenarlardan %4 boşluk kalsın */
    max-width: 550px; /* Masaüstünde çok yayılmasın */
    margin: 20px auto; /* Üstten alttan boşluk, yanlardan ortala */
    padding: 0; /* İç boşluğu sıfırladık, genişliği width ile yöneteceğiz */
}

.gizle { display: none !important; }

/* --- KART YAPISI --- */
.kart-izgara {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Kartlar arası boşluk */
    width: 100%;
}

.kart {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden; /* İçerik taşarsa gizle */
    border: 1px solid rgba(255,255,255,0.5);
    width: 100%;
}

.kart-baslik-alani, .hava-ust-panel, .baslik-cubugu {
    background: var(--bg-header);
    color: var(--text-white);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.kart h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kart-icerik { 
    padding: 15px; 
}

/* --- FORM ELEMANLARI --- */
.giris-kutusu {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    text-align: center;
    margin-top: 60px;
    width: 90%;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

.giris-kutusu h2 {
    background: var(--bg-header);
    color: white;
    margin: 0;
    padding: 15px;
    font-size: 1.1rem;
}

.giris-form-body { padding: 20px; }

input[type="password"], 
input[type="text"], 
input[type="time"],
input[type="number"],
input[type="date"] {
    width: 100%;
    max-width: 100%; /* Taşmayı engeller */
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem; 
    transition: all 0.2s ease;
    outline: none;
}

input:focus {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--btn-bg);
    transition: 0.2s;
    font-size: 1rem;
}

button:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

/* --- HAVA DURUMU --- */
.sol-kisim { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    flex-wrap: wrap; 
    max-width: 70%; /* Yazıların sağa taşmasını engeller */
}
.sehir-adi { font-size: 1rem; font-weight: bold; color: var(--text-white); display: flex; align-items: center; gap: 5px;}
.anlik-bilgi { display: flex; align-items: center; gap: 5px; color: var(--text-white); }

select.ozel-select {
    padding: 5px 8px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    cursor: pointer;
}

.yatay-scroll-alani {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 5px 2px 10px 2px;
    margin-top: 5px;
    width: 100%;
    /* Mobilde kaydırma çubuğunu gizle ama kaydırmaya izin ver */
    scrollbar-width: none; 
    -ms-overflow-style: none;  
}
.yatay-scroll-alani::-webkit-scrollbar { display: none; }

.saat-kutusu {
    background: #fff;
    min-width: 60px; /* Biraz daha daralttık */
    padding: 8px 4px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0; /* Küçülüp bozulmasın */
}
.saat-kutusu .zaman { font-size: 0.7rem; color: var(--text-secondary); font-weight: 600; }
.saat-kutusu .ikon { font-size: 1.3rem; margin: 2px 0; }
.saat-kutusu .derece { font-weight: 700; font-size: 0.85rem; color: var(--text-primary); }

/* --- LİSTE VE TABLOLAR --- */
ul { list-style-type: none; padding: 0; margin: 0; }
li {
    padding: 12px 5px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}
li:last-child { border-bottom: none; }

/* GERİ BUTONU */
.geri-btn {
    color: var(--text-white); text-decoration: none; border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 10px; border-radius: 6px; font-size: 0.8rem; transition: 0.3s;
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.geri-btn:hover { background: rgba(255,255,255,0.2); }

/* --- MOBİL İÇİN ÖZEL DÜZELTMELER --- */
@media (max-width: 480px) {
    .konteyner {
        width: 94%; /* Mobilde kenar boşluğu %3 sağ %3 sol */
        margin: 15px auto;
    }
    
    .kart-baslik-alani, .hava-ust-panel {
        padding: 10px;
    }
    
    .kart h2 { font-size: 0.9rem; }
    
    /* Uzun şehir isimleri taşmasın diye */
    .sehir-adi {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .anlik-bilgi { font-size: 0.9rem; }
    
    /* Tablolarda yazı küçültme */
    li span { font-size: 0.85rem; }
}