:root {
    --primary-color: #4CAF50; /* Yeşil */
    --secondary-color: #2196F3; /* Mavi */
    --accent-color: #FFC107; /* Sarı */
    --text-color: #333;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow-light: 0 4px 8px rgba(0,0,0,0.05);
    --shadow-medium: 0 8px 16px rgba(0,0,0,0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Yatay kaydırmayı engelle */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 30px 0;
    text-align: center;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 70%);
    transform: rotate(45deg);
    animation: header-bg-pulse 15s infinite alternate;
}

@keyframes header-bg-pulse {
    0% { transform: rotate(45deg) scale(1); opacity: 0.8; }
    100% { transform: rotate(45deg) scale(1.1); opacity: 1; }
}

.main-header h1 {
    font-family: 'DM Mono', monospace;
    font-size: 3.2em;
    margin-bottom: 5px;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    color: #FFD700; /* Ritim Akademisi başlık rengi: Altın sarısı */
}

.main-header h1 i {
    margin-right: 15px;
    color: #FF6347; /* Davul ikonu rengi: Turuncu/Kırmızı */
    transform: rotate(-10deg);
}

.main-header p {
    font-size: 1.2em;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    color: #ADD8E6; /* Müziğin kalbini keşfet yazı rengi: Açık Mavi */
    display: flex; /* Kalbi hizalamak için flexbox kullan */
    justify-content: center; /* Ortala */
    align-items: center; /* Dikeyde ortala */
    gap: 8px; /* Yazı ile ikon arasına boşluk */
}

/* Kalp ikonu için animasyonlu pseudo-element */
.main-header p::after {
    content: '\f004'; /* Font Awesome kalp ikonu kodu */
    font-family: 'Font Awesome 5 Free'; /* Font Awesome font ailesi */
    font-weight: 900; /* İkonun dolu olması için */
    color: #FF4500; /* Kalp rengi: Koyu Turuncu/Kırmızı */
    font-size: 1.2em;
    animation: pulse 1.5s infinite ease-in-out; /* Atma animasyonu */
    display: inline-block; /* Margin ve animasyon için */
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 0;
}

.hero-section {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 40px;
    animation: fade-in 1s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-section h2 {
    font-size: 2.8em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.1em;
    max-width: 700px;
    margin: 0 auto 30px auto;
}

/* Ritim ve Zaman Açıklaması */
.rhythm-time-explanation {
    margin-top: 30px;
    padding: 25px;
    background-color: var(--light-bg);
    border-radius: 10px;
    border: 1px dashed var(--primary-color);
    text-align: left; /* Metni sola hizala */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
    margin-bottom: 30px; /* Alttaki butondan boşluk */
}

.rhythm-time-explanation h4 {
    font-size: 1.6em;
    color: var(--secondary-color);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.rhythm-time-explanation p {
    font-size: 1em;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 10px;
}

.rhythm-time-explanation p strong {
    color: var(--primary-color);
}


.cta-button {
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4);
}

.cta-button:hover {
    background-color: #ffda6a;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 193, 7, 0.6);
}

/* Module Cards */
.module-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease-in-out;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.module-card h3 {
    font-size: 2em;
    color: var(--secondary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.module-card h3 i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Ritim Temelleri */
.note-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.note-item {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
}

.note-item:hover {
    background-color: #eaf7ed;
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

.note-item img {
    max-width: 100px;
    height: auto;
    margin-bottom: 15px;
}

.note-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.note-duration {
    font-family: 'DM Mono', monospace;
    font-size: 0.95em;
    color: var(--text-color);
    margin-bottom: 15px;
}

.play-note-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.play-note-btn:hover {
    background-color: #43a047;
    transform: translateY(-2px);
}

.play-note-btn:active {
    transform: translateY(0);
}

/* Metronom */
.metronome-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 10px;
    border: 1px dashed var(--secondary-color);
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="range"] {
    width: 180px;
    -webkit-appearance: none;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
    outline: none;
    transition: opacity .2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    background-color: white;
    appearance: none; /* Varsayılan select stilini kaldır */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
}

.control-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-button:hover {
    background-color: #1976d2;
    transform: translateY(-2px);
}

.control-button:active {
    transform: translateY(0);
}

.metronome-visualizer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    height: 50px;
    align-items: center;
}

.metronome-beat-light {
    width: 25px;
    height: 25px;
    background-color: #ccc;
    border-radius: 50%;
    transition: background-color 0.1s ease-out, transform 0.1s ease-out;
}

.metronome-beat-light.active {
    background-color: var(--primary-color); /* Vuruş geldiğinde yeşil */
    transform: scale(1.2);
}

.metronome-beat-light.accent {
    background-color: var(--accent-color); /* İlk vuruşta sarı */
    transform: scale(1.3);
}

/* Davul Makinesi */
.drum-pads {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.drum-pad {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 30px 40px;
    border-radius: 15px;
    font-size: 1.4em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
    flex-basis: 180px; /* Esnek boyutlandırma */
    text-align: center;
}

.drum-pad:hover {
    background-color: #1976d2;
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-medium);
}

.drum-pad:active {
    background-color: #1565c0;
    transform: translateY(0) scale(1);
}

/* Ritim Oyunu */
.how-to-play-link {
    text-align: center;
    margin-top: -10px; /* Modül başlığının altına daha yakın olması için */
    margin-bottom: 20px; /* Oyun alanından biraz boşluk bırak */
}

.how-to-play-link a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.how-to-play-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.game-area {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--light-bg);
    margin-top: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.rhythm-track {
    position: absolute;
    top: 50%;
    height: 80px; /* Notaların görüneceği şeridin yüksekliği */
    transform: translateY(-50%);
    width: 100%; /* İçindeki notalar sağdan sola kayacak */
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.game-note-item {
    position: absolute;
    height: 60px; /* Nota resminin yüksekliği */
    width: auto;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.05s ease-out; /* Hızlı basma animasyonu için */
    will-change: transform, opacity; /* Animasyon performansı için */
}

.game-note-item img {
    height: 100%;
    width: auto;
    display: block;
}

.game-note-item.hit {
    background-color: rgba(76, 175, 80, 0.5); /* Vurulduğunda geçici arka plan */
    border-radius: 5px;
    opacity: 0.5;
    transform: translateY(-50%) scale(1.1); /* Hafif büyüsün */
}

.game-note-item.missed {
    background-color: rgba(244, 67, 54, 0.5);
    border-radius: 5px;
    opacity: 0.3;
}

.hit-marker {
    position: absolute;
    left: 25%; /* Vuruş çizgisi */
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--accent-color);
    z-index: 10;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.7);
    border-radius: 2px;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.game-feedback {
    text-align: right;
}

.game-feedback p {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
}

#game-message {
    color: var(--primary-color);
}

/* Footer */
.main-footer {
    background-color: var(--dark-bg);
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Responsive Düzenlemeler */
@media (max-width: 768px) {
    .main-header h1 {
        font-size: 2.5em;
    }

    .hero-section {
        padding: 40px 15px;
    }

    .hero-section h2 {
        font-size: 2em;
    }

    .note-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .note-item img {
        max-width: 80px;
    }

    .drum-pad {
        padding: 20px 30px;
        font-size: 1.2em;
        flex-basis: 150px;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 2em;
    }

    .main-header p {
        font-size: 1em;
    }

    .module-card {
        padding: 20px;
    }

    .module-card h3 {
        font-size: 1.6em;
    }

    .cta-button, .control-button {
        width: 100%;
        padding: 12px 20px;
        text-align: center;
    }

    .metronome-controls {
        flex-direction: column;
    }
}