/* Genel Stil */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #111;
    position: relative;
}

/* UI Alanları */
#ui-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    background-color: rgba(0, 0, 0, 0.3);
    font-size: 1.2em;
    font-weight: bold;
    z-index: 10;
    box-sizing: border-box;
}

#level-lives-container {
    display: none; /* Varsayılan olarak gizli */
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ui-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 10;
    box-sizing: border-box;
}

/* Görev ve Güçlendirme Çubukları */
#mission-container p {
    margin: 0 0 5px 0;
    font-size: 0.9em;
}

.progress-bar-container {
    width: 100%;
    background-color: #555;
    border-radius: 5px;
    height: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4caf50;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* Modal Ekranlar */
.modal-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); 
    display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; visibility: hidden; 
    transition: opacity 0.3s, visibility 0.3s; 
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { 
    background-color: #333; padding: 25px; border-radius: 15px; text-align: center; width: 85%; max-width: 400px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4); transform: scale(0.9); transition: transform 0.3s; 
}

.modal-overlay.active .modal-content { transform: scale(1); }
.modal-content h1, .modal-content h2 { margin-top: 0; color: #4caf50; }
.modal-content h3 { margin-top: 20px; color: #4caf50; border-bottom: 1px solid #555; padding-bottom: 5px;}

/* Animasyonlar ve Düğmeler */
@keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); } 20%, 40%, 60%, 80% { transform: translateX(5px); } }
.shake { animation: shake 0.5s; }
button { background-color: #4caf50; color: white; border: none; padding: 12px 25px; border-radius: 8px; font-size: 1em; cursor: pointer; transition: background-color 0.2s, transform 0.1s; margin-top: 10px; }
button:hover { background-color: #45a049; }
button:active { transform: scale(0.95); }
button:disabled { background-color: #666; cursor: not-allowed; }

/* Ayarlar Paneli */
.settings-container hr { border-color: #555; margin: 20px 0; }
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.setting-item label {
    font-size: 1em;
}

.setting-item select {
    background-color: #555;
    color: white;
    border: 1px solid #777;
    padding: 5px;
    border-radius: 5px;
}

.setting-item input[type="range"] {
    width: 60%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #555;
    outline: none;
    border-radius: 5px;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #4caf50;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.setting-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #4caf50;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Switch (Toggle) Stilleri */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4caf50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4caf50;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Toast Bildirimleri */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast-notification {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    font-size: 0.9em;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    opacity: 1;
}

/* Mağaza Stilleri */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.shop-header h2 {
    margin-bottom: 0;
}

#close-shop-btn {
    background: #f44336;
    margin-top: 0;
}

.shop-tabs { display: flex; margin-bottom: 15px; border-bottom: 2px solid #555; overflow-x: auto; white-space: nowrap; }
.tab-link { flex: 1; padding: 10px; background: none; border: none; color: #aaa; font-size: 0.9em; border-radius: 0; margin-top: 0; }
.tab-link.active { color: #4caf50; border-bottom: 2px solid #4caf50; }
.tab-content { display: none; max-height: 400px; overflow-y: auto; }
.tab-content.active { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; }
.shop-item { background-color: #444; padding: 10px; border-radius: 10px; text-align: center; display: flex; flex-direction: column; justify-content: space-between; }
.item-preview { width: 60px; height: 60px; border-radius: 8px; margin: 0 auto 10px; display: flex; justify-content: center; align-items: center; font-size: 2.5em; background-color: #2c2c2c; }
.shop-item p { margin: 0 0 5px 0; font-size: 0.9em; flex-grow: 1; }
.shop-item button { width: 100%; padding: 8px; font-size: 0.9em; }
.shop-item button.equipped { background-color: #666; color: #ccc; }

/* Bölüm Seçim Ekranı */
.level-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
    margin-top: 20px;
    border: 1px solid #444;
    border-radius: 10px;
}

.level-item {
    background-color: #444;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    border: 2px solid transparent;
}

.level-item.unlocked:hover {
    background-color: #555;
    border-color: #4caf50;
}

.level-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #3a3a3a;
}

.level-item h3 {
    margin: 5px 0;
    color: #4caf50;
}

.level-item p {
    margin: 5px 0;
    font-size: 0.9em;
}

.level-item button {
    margin-top: 10px;
    width: 80%;
}

.level-item.locked button {
    display: none;
}

/* Reklam Stilleri */
.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    font-size: 2em;
}

#ad-countdown {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5em;
    background-color: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 50%;
}

#powerup-container {
    position: absolute;
    bottom: 70px; 
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.powerup-indicator {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 8px;
}

.powerup-indicator span {
    font-size: 1.5em;
    margin-right: 10px;
}

.powerup-indicator .progress-bar-container {
    width: 80px;
    height: 8px;
}

@media (max-width: 600px) {
    #ui-top {
        font-size: 1em;
        padding: 10px 5px;
    }
    #ui-bottom {
        padding: 8px 10px;
    }
    .modal-content {
        width: 90%;
        padding: 20px;
    }
    button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    .tab-link {
        font-size: 0.8em;
    }
    .shop-item {
        gap: 10px;
    }
    .item-preview {
        width: 50px;
        height: 50px;
        font-size: 2em;
    }
    .shop-item p {
        font-size: 0.8em;
    }
    .shop-item button {
        font-size: 0.8em;
    }
}

/* Yeni eklenen can barı için stil */
#lives-container {
    display: flex;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
}

.heart-icon {
    color: red;
    margin-right: 5px;
}

/* Klasik Görevler Ekranı Stilleri */
#classic-challenges-screen .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

#classic-challenges-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
    text-align: left;
}

.classic-challenge-item {
    background-color: #444;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.classic-challenge-item.completed {
    border-color: #4caf50;
    background-color: #3a4a3a;
}

.classic-challenge-item h3 {
    margin-top: 0;
    color: #4caf50;
}

.classic-challenge-item p {
    margin: 5px 0;
    font-size: 0.9em;
}

.classic-challenge-item .status {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #bbb;
}
