:root {
    --glass-bg: rgba(0, 0, 0, 0.35);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-color: #ffffff;
    --accent-color: #ffd700;
    --hover-bg: rgba(255, 255, 255, 0.08);
    --skeleton-bg: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Quicksand', sans-serif;
}

body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    background-color: #1a1a1a;
    color: var(--text-color);
    /* Sidebar'ı ortalamak için Flexbox */
    display: flex;
    align-items: center;
    /* Dikey ortalı */
    justify-content: flex-start;
    /* Sola yaslı */
    padding-left: 5%;
    /* Kenardan boşluk */
}

#background-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: background-image 1s ease-in-out;
}

/* Hafif karartma (gradient) ki sol taraf daha okunaklı olsun */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0) 100%);
    z-index: -1;
}

/* Sidebar Tasarımı (Kutu Modu - Nano Tasarım) */
.sidebar {
    height: auto;
    min-height: 350px;
    /* Daha da küçültüldü */
    width: 240px;
    /* 280'den 240'a düşürüldü */
    max-width: 75vw;

    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;

    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    /* Padding azaltıldı */
    gap: 0.6rem;
    /* Gap azaltıldı */
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

header {
    margin-bottom: 0.8rem;
    position: relative;
    width: 100%;
    padding-top: 1.5rem;
    /* Space for the absolute lang toggle */
}

.search-wrapper {
    position: relative;
    width: 100%;
}

#city-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 12px 20px;
    font-family: 'Quicksand', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(5px);
}

#city-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    font-size: 0.95rem;
}

#city-search:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.autocomplete-items {
    position: absolute;
    border-radius: 12px;
    z-index: 9999;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.autocomplete-items:empty {
    display: none;
}

.autocomplete-items div {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    transition: background 0.2s;
    text-align: left;
    color: white;
}

.autocomplete-items div:last-child {
    border-bottom: none;
}

.autocomplete-items div:hover,
.autocomplete-items div.autocomplete-active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--accent-color);
}

.autocomplete-items .state-item {
    font-weight: 600;
    color: #ffd79d;
    background: rgba(255, 215, 0, 0.05);
}

.autocomplete-items .city-item {
    padding-left: 25px;
    opacity: 0.95;
    color: #e0e0e0;
}

#current-date {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 10px;
    line-height: 1.4;
    text-align: center;
}

.hijri-date {
    display: block;
    font-size: 0.8em;
    color: var(--accent-color);
    opacity: 0.85;
    margin-top: 2px;
    font-weight: 400;
}

.lang-toggle-btn {
    position: absolute;
    top: -10px;
    right: 5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Liste Tasarımı */
.prayer-times-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    /* Gap azaltıldı */
    flex-grow: 1;
}

.prayer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 8px;
    /* Daha kompakt */

    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prayer-item:hover {
    background: var(--hover-bg);
    transform: translateX(3px);
}

.prayer-item.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}

.prayer-name {
    /* Küçültüldü */
    font-size: 0.85rem;

    font-weight: 500;
    letter-spacing: 0.3px;
}

.prayer-time {
    font-size: 1rem;
    font-weight: 700;

}

/* Skeleton Loading */
.skeleton {
    background: var(--skeleton-bg);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    width: 60px;
}

.skeleton-time {
    height: 1.2rem;
    width: 45px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.loading-container {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

/* Boşluk Bırakıcı */
.spacer {
    flex-grow: 1;
}

/* Sayaç Alanı */
.timer-card {
    margin-top: auto;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.weekly-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.weekly-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.weekly-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 2rem;
    overflow-y: auto;
}

.weekly-view.active {
    display: flex;
}

.weekly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.weekly-header h2 {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.close-weekly {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.weekly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.day-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    transition: transform 0.2s;
}

.day-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.day-card.today {
    border-color: var(--accent-color);
    background: rgba(255, 215, 0, 0.05);
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--accent-color);
}

.day-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-date {
    font-size: 0.95rem;
    font-weight: 700;
}

.day-name {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.today-badge {
    background: var(--accent-color);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
}

.day-times {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    font-size: 0.8rem;
}

.day-time-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 4px;
}

.day-time-name {
    opacity: 0.6;
    font-size: 0.7rem;
}

#next-prayer-name {
    font-size: 0.75rem;
    /* Küçültüldü */
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

#countdown {
    font-size: 2rem;
    /* Küçültüldü */
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: -1px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-left: 0;
        justify-content: center;
        align-items: center;
        /* Dikeyde de ortala */
    }

    .sidebar {
        width: 85vw;
        /* Genişliği ekrana göre ayarla */
        max-width: 320px;
        /* Çok geniş olmasın */
        padding: 0.8rem;
        /* İç boşluğu azalt */
        gap: 0.4rem;
        /* Elemanlar arası boşluğu azalt */
        min-height: auto;
        border-radius: 16px;
    }

    /* Mobilde arama ve başlık kısmı daha kompakt */
    header {
        margin-bottom: 0.5rem;
        padding-top: 1.8rem;
        /* Dil butonu için daha fazla boşluk */
    }

    #city-search {
        padding: 8px 12px;
        font-size: 1rem;
    }

    #current-date {
        font-size: 0.8rem;
        margin-top: 5px;
    }

    .lang-toggle-btn {
        top: -8px;
        right: 5px;
        padding: 4px 7px;
        font-size: 0.7rem;
    }

    /* Mobilde liste daha sıkı */
    .prayer-item {
        padding: 4px 8px;
    }

    .prayer-name {
        font-size: 0.9rem;
    }

    .prayer-time {
        font-size: 1rem;
    }

    /* Timer kartı daha küçük */
    .timer-card {
        padding-top: 0.6rem;
        padding-bottom: 0.2rem;
    }

    #next-prayer-name {
        font-size: 0.7rem;
        margin-bottom: 0;
    }

    #countdown {
        font-size: 1.8rem;
    }

    .weekly-toggle-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
        margin-top: 6px;
    }
}

@media (max-height: 700px) and (max-width: 768px) {

    /* Çok kısa ekranlı telefonlar için ekstra sıkılaştırma */
    .sidebar {
        padding: 0.6rem;
        gap: 0.2rem;
    }

    .prayer-item {
        padding: 2px 6px;
    }

    #current-date {
        display: none;
        /* Yer yoksa tarihi gizle */
    }
}

/* Tablet Responsive (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding-left: 0;
        justify-content: center;
        align-items: center;
    }

    .sidebar {
        width: 280px;
        /* Daha küçük */
        max-width: 80vw;
        padding: 1rem;
        gap: 0.5rem;
        min-height: auto;
        /* Ekrana yapışmayı önle */
    }

    header {
        margin-bottom: 0.6rem;
        padding-top: 2rem;
        /* Dil butonu için daha fazla boşluk */
    }

    #city-search {
        padding: 10px 16px;
        font-size: 1.05rem;
    }

    #current-date {
        font-size: 0.85rem;
    }

    .lang-toggle-btn {
        top: -6px;
        /* Daha az negatif değer */
        right: 5px;
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .prayer-item {
        padding: 5px 10px;
    }

    .prayer-name {
        font-size: 0.9rem;
    }

    .prayer-time {
        font-size: 1.05rem;
    }

    .timer-card {
        padding-top: 0.8rem;
        padding-bottom: 0.4rem;
    }

    #next-prayer-name {
        font-size: 0.75rem;
    }

    #countdown {
        font-size: 2rem;
    }

    .weekly-toggle-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .weekly-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.2rem;
    }
}