﻿@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---------------------------------------------------- */
/* KÖK DEĞİŞKENLER (SADE VE TAMAMEN MAVİ TEMA)        */
/* ---------------------------------------------------- */

:root {
    --bg-color: #f4f6f9; /* Açık Gri Arka Plan (Default) */
    --text-color: #333333; /* Koyu Gri Metin */
    --primary-color: #007bff; /* Temiz Mavi (Ana Vurgu) */
    --primary-hover-color: #0056b3;
    --secondary-color: #ffffff; /* Kartlar ve Header için Beyaz */
    --border-color: #e0e0e0; /* İnce Açık Gri Kenarlık */
    --accent-color: #1a4269; /* Koyu Mavi (Başlıklar ve İkincil Vurgu) */
    /* Efektler ve Gölgeler */
    --transition-speed: 0.3s;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.2);
}


.dark-theme { /* Koyu tema sadeleştiriliyor */
    --bg-color: #1a1a2e;
    --text-color: #e0e7ff;
    --primary-color: #4a90e2;
    --primary-hover-color: #357bd9;
    --secondary-color: #2c2c44;
    --border-color: #444466;
    --accent-color: #7b9fd9;
    --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.7);
}


/* ---------------------------------------------------- */
/* GENEL STİL VE GEÇİŞLER             */
/* ---------------------------------------------------- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Mobil dokunma rengini kaldır */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto', 'Inter', sans-serif;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 95%; /* Mobil cihazlarda daha fazla alan */
    max-width: 1200px;
    margin: 0 auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

    a:hover {
        color: var(--primary-hover-color);
        transform: translateY(-1px);
    }

/* Preloader */
#preloader {
    position: fixed;
    height: 100vh;
    width: 100%;
    top: 0;
    left: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-brand-name {
    font-size: 3em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.loader-spinner {
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    margin-top: 25px;
    font-size: 1.6em;
    font-weight: 400;
    opacity: 0.8;
}

    .loading-text.hidden-initially {
        opacity: 0;
    }

    .loading-text.fade-in-text {
        animation: textFadeIn 0.5s ease-out forwards;
    }


/* ---------------------------------------------------- */
/* HEADER VE NAVİGASYON (MOBİL İÇİN GÜÇLENDİRİLDİ)     */
/* ---------------------------------------------------- */

#mainHeader {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--secondary-color);
    box-shadow: var(--shadow-light);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
    z-index: 1000;
}

    #mainHeader .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.logo-icon {
    font-size: 1.2em;
    margin-right: 8px;
    color: var(--primary-color);
    transition: transform 0.4s ease-in-out;
}

.logo:hover .logo-icon {
    transform: rotate(5deg) scale(1.05);
}

.main-nav {
    display: none; /* Mobil cihazlarda varsayılan olarak gizli (JS ile açılması beklenir) */
    width: 100%;
    order: 3;
    padding-top: 10px;
}

    .main-nav ul {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        text-align: center;
        border-top: 1px solid var(--border-color);
    }

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 12px 0; /* Büyük dokunma alanı */
    position: relative;
    transition: all var(--transition-speed);
    display: block;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--secondary-color);
}

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0%;
        height: 2px;
        background-color: var(--primary-color);
        transition: width var(--transition-speed) ease-out;
    }

    .nav-link:hover {
        color: var(--primary-color);
        background-color: var(--bg-color);
    }

        .nav-link:hover::after {
            width: 100%;
        }

.theme-toggle-btn {
    font-size: 1.2em;
    padding: 10px 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-speed);
}

    .theme-toggle-btn:hover {
        background-color: var(--primary-hover-color);
        transform: rotate(15deg) scale(1.1);
    }

.theme-switcher {
    display: flex;
    align-items: center;
    order: 2;
}

/* ---------------------------------------------------- */
/* ARAMA VE BUTONLAR (MOBİL İÇİN DÜZELTİLDİ)          */
/* ---------------------------------------------------- */

.search-section {
    padding: 30px 0 40px;
    text-align: center;
}

.page-title {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--accent-color);
    animation: slideInLeft 0.5s ease-out forwards;
}

input[type="text"], select, .form-control, .theme-button {
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed);
    font-size: 1.1em;
    width: 100%;
    max-width: 400px;
}

.form-control {
    background-color: var(--secondary-color);
    color: var(--text-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="rgb(180,180,180)" d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px var(--primary-color), 0 0 0 5px rgba(0, 123, 255, 0.2);
        outline: none;
    }

.primary-action-button {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    border: none;
    padding: 14px 25px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-speed);
    width: 100%;
    max-width: 400px;
}

    .primary-action-button:hover {
        transform: translateY(-2px);
        background-color: var(--primary-hover-color);
        box-shadow: var(--shadow-medium);
    }

.search-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-direction: column;
}


/* ---------------------------------------------------- */
/* İÇERİK VE KARTLAR (MOBİL İÇİN GÜÇLENDİRİLDİ)       */
/* ---------------------------------------------------- */

#mainContent {
    flex-grow: 1;
    padding: 30px 0;
}

.weather-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    animation: fadeIn 0.8s ease-out forwards;
}

.weather-card {
    padding: 25px;
    border-radius: 12px;
    background-color: var(--secondary-color);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

    .weather-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }

/* Mevcut Hava Durumu */
.city-name {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-color);
}

.last-update {
    font-size: 0.85em;
    color: #999999;
}

.main-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.weather-icon {
    font-size: 4.5em;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.main-temp {
    font-size: 5em;
    font-weight: 300;
    color: var(--primary-color);
    line-height: 1;
}

.description {
    font-size: 1.3em;
    font-weight: 500;
    margin-top: 10px;
    color: var(--accent-color);
}

.feels-like-bar {
    padding: 12px;
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 8px;
    font-size: 1em;
    border: 1px solid rgba(0, 123, 255, 0.3);
    text-align: center;
    margin-top: 15px;
    width: 100%;
}

    .feels-like-bar strong {
        color: var(--primary-color);
        font-weight: 600;
    }

/* Popüler Şehirler */
.popular-cities-section {
    padding: 30px 0;
}

.section-title {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    font-weight: 600;
}

.popular-cities-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.small-weather-card {
    padding: 12px;
    border-radius: 8px;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-speed);
}

    .small-weather-card:hover {
        transform: translateY(-3px);
        border-color: var(--primary-color);
        box-shadow: var(--shadow-medium);
    }

/* Detay Kartı ve AI Yorumu */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobil cihazda 2x2 düzen */
    gap: 10px;
    margin-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.details-title {
    grid-column: 1 / -1;
    font-size: 1.4em;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 6px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s;
}

    .detail-item:hover {
        transform: scale(1.03);
    }

    .detail-item strong {
        color: var(--accent-color);
        font-size: 0.9em;
    }

    .detail-item span:last-child {
        font-size: 1.2em;
        font-weight: 700;
        margin-top: 3px;
    }


.daily-forecast-card {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: var(--shadow-light);
}

.forecast-title {
    font-size: 1.4em;
    color: var(--accent-color);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.ai-comment-text {
    line-height: 1.6;
    font-size: 1em;
    font-style: italic;
    color: var(--text-color);
}


/* ---------------------------------------------------- */
/* FOOTER                               */
/* ---------------------------------------------------- */

#mainFooter {
    padding: 20px 0;
    margin-top: auto;
    background-color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9em;
    color: #999999;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}


/* ---------------------------------------------------- */
/* MEDYA SORGULARI (RESPONSIVE)       */
/* ---------------------------------------------------- */

/* 768px ve üzeri (Tablet ve Masaüstü) */
@media (min-width: 768px) {
    .container {
        width: 90%;
    }

    .logo {
        flex-grow: 0;
    }

    .main-nav {
        display: block;
        width: auto;
        order: initial;
        flex-grow: 1;
        text-align: right;
        padding-top: 0;
    }

        .main-nav ul {
            flex-direction: row;
            justify-content: flex-end;
            gap: 25px;
            border-top: none;
        }

    .nav-link {
        padding: 8px 0;
        border-bottom: none;
    }

    .search-controls {
        flex-direction: row;
        gap: 20px;
    }

    .form-control, .primary-action-button {
        width: auto;
        max-width: none;
        min-width: 250px;
    }

    .weather-card-grid {
        grid-template-columns: 3fr 2fr;
        gap: 30px;
    }

    .main-info {
        flex-direction: row;
        gap: 30px;
    }

    .city-name {
        font-size: 2.5em;
    }

    .main-temp {
        font-size: 5.5em;
    }

    .details-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 15px;
    }
}
