/* ===================================
   RESET & BASE STYLES
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== MOBILE TOUCH OPTIMIZATIONS ===== */
/* Remove tap highlight on all interactive elements for cleaner mobile UX */
button, a, select, input[type="range"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* Prevent double-tap zoom */
}

/* Better active states for touch feedback */
button:active, .position-btn:active, .control-btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Improve focus visibility for accessibility */
button:focus-visible, select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

:root {
    --primary-color: #6C5CE7;
    --secondary-color: #A29BFE;
    --accent-color: #FD79A8;
    --success-color: #00B894;
    --warning-color: #FDCB6E;
    --dark-bg: #2D3436;
    --light-bg: #F8F9FA;
    --text-dark: #2D3436;
    --text-light: #636E72;
    --white: #FFFFFF;
    --gradient-1: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    --gradient-2: linear-gradient(135deg, #F093FB 0%, #F5576C 100%);
    --gradient-3: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
    --gradient-4: linear-gradient(135deg, #FA709A 0%, #FEE140 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
    overflow-x: hidden; /* Prevent horizontal scroll */
    max-width: 100vw; /* Ensure viewport width constraint */
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--light-bg);
    overflow-x: hidden;
    max-width: 100vw; /* Ensure viewport width constraint */
    position: relative;
}

* {
    box-sizing: border-box; /* Prevent padding from expanding elements */
}

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

/* ===================================
   NAVIGATION
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.guitar-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.logo-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Language Selector */
.nav-language {
    display: flex;
    align-items: center;
}

.language-selector {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.language-selector:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.language-selector:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(116, 119, 255, 0.2);
}

.language-selector option {
    padding: 0.5rem;
    font-weight: 600;
}

.nav-user {
    position: relative;
    display: flex;
    align-items: center;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.user-profile-btn:hover #user-name {
    color: var(--white);
}

.user-profile-btn:hover .dropdown-arrow {
    color: var(--white);
}

#user-name {
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.user-profile-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 420px;
    max-width: calc(100vw - 2rem);
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 1000;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--gradient-1);
    color: var(--white);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.user-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.user-level {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--light-bg);
}

.user-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    min-height: 80px;
}

.stat-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    line-height: 1.2;
    word-wrap: break-word;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--light-bg);
    margin: 1rem 1.5rem;
}

.dropdown-profile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    margin: 0 0.75rem;
    background: var(--gradient-1);
    color: var(--white);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dropdown-profile-link:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(88, 86, 214, 0.3);
}

.link-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.dropdown-profile-link:hover .link-arrow {
    transform: translateX(4px);
}

.user-dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.5rem 1.5rem;
}

.dropdown-action-btn {
    padding: 0.75rem 1rem;
    background: var(--light-bg);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.dropdown-action-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateX(4px);
}

.dropdown-action-btn.logout-action {
    background: #fee;
    color: #c00;
}

.dropdown-action-btn.logout-action:hover {
    background: #c00;
    color: var(--white);
}

.logout-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--light-bg);
    color: var(--text-dark);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: translateY(-2px);
}

.retake-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.retake-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    position: relative;
    overflow: hidden;
    padding: 100px 20px 50px;
}

.hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: float 6s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.hero-content {
    max-width: 800px;
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.title-line {
    display: block;
    animation: slideInLeft 0.8s ease-out;
}

.title-line.highlight {
    background: linear-gradient(135deg, #FEE140 0%, #FA709A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInRight 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-button {
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--white);
    color: var(--primary-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.button-arrow {
    transition: transform 0.3s ease;
}

.cta-button:hover .button-arrow {
    transform: translateX(5px);
}

.floating-notes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.floating-notes .note {
    position: absolute;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    animation: floatNote 10s ease-in-out infinite;
}

.floating-notes .note:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-notes .note:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-notes .note:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
}

.floating-notes .note:nth-child(4) {
    top: 40%;
    right: 25%;
    animation-delay: 6s;
}

@keyframes floatNote {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) rotate(10deg);
        opacity: 0.6;
    }
}

/* ===================================
   SECTIONS
   =================================== */
section {
    padding: 100px 20px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

/* ===================================
   ASSESSMENT SECTION
   =================================== */
.assessment-section {
    background: var(--white);
}

.assessment-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.question-card {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.question-card.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.question-card h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.question-hint {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.options-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.option-btn {
    padding: 1.2rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: var(--light-bg);
    color: var(--text-dark);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.option-btn.selected {
    background: var(--gradient-1);
    color: var(--white);
    border-color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-bg);
    border-radius: 10px;
    margin-top: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.result-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    animation: scaleIn 0.6s ease-out;
}

.result-container.hidden {
    display: none;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-badge {
    margin-bottom: 2rem;
}

.badge-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    animation: bounceIn 0.8s ease-out;
}

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

.result-level {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.result-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.reset-assessment-btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-assessment-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.reset-icon {
    font-size: 1.2rem;
    animation: rotate 2s linear infinite;
}

.reset-assessment-btn:hover .reset-icon {
    animation: rotate 0.5s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   LEARNING MODULES
   =================================== */
.learning-section {
    background: linear-gradient(180deg, var(--white) 0%, var(--light-bg) 100%);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.module-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: slideInUp 0.6s ease forwards;
}

/* Staggered entrance animations */
.module-card:nth-child(1) {
    animation-delay: 0.1s;
}

.module-card:nth-child(2) {
    animation-delay: 0.2s;
}

.module-card:nth-child(3) {
    animation-delay: 0.3s;
}

.module-card:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.module-card:hover::before {
    transform: scaleX(1);
}

.module-card:nth-child(2)::before {
    background: var(--gradient-2);
}

.module-card:nth-child(3)::before {
    background: var(--gradient-3);
}

.module-card:nth-child(4)::before {
    background: var(--gradient-4);
}

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

.module-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

/* PICK TECHNIQUE - Strumming motion animation */
.module-card[data-module="pick"] .module-icon {
    animation: pickStrum 2s ease-in-out infinite;
}

@keyframes pickStrum {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(-5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(8px) rotate(5deg); }
}

.module-card[data-module="pick"]:hover .module-icon {
    animation: pickStrumFast 0.8s ease-in-out infinite;
}

@keyframes pickStrumFast {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1.1); }
    25% { transform: translateY(-12px) rotate(-8deg) scale(1.15); }
    50% { transform: translateY(0) rotate(0deg) scale(1.1); }
    75% { transform: translateY(12px) rotate(8deg) scale(1.15); }
}

/* RHYTHM & TIMING - Metronome pulse animation */
.module-card[data-module="rhythm"] .module-icon {
    animation: metronomePulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes metronomePulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.15);
        filter: brightness(1.3) drop-shadow(0 0 10px rgba(108, 92, 231, 0.5));
    }
}

.module-card[data-module="rhythm"]:hover .module-icon {
    animation: metronomePulseFast 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes metronomePulseFast {
    0%, 100% {
        transform: scale(1.1);
        filter: brightness(1.1);
    }
    50% {
        transform: scale(1.3);
        filter: brightness(1.5) drop-shadow(0 0 15px rgba(108, 92, 231, 0.7));
    }
}

/* SCALES & PATTERNS - Ascending/descending scale motion */
.module-card[data-module="scales"] .module-icon {
    animation: scaleAscend 3s ease-in-out infinite;
}

@keyframes scaleAscend {
    0% {
        transform: translateY(10px) scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-10px) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateY(10px) scale(0.95);
        opacity: 0.8;
    }
}

.module-card[data-module="scales"]:hover .module-icon {
    animation: scaleAscendFast 1.2s ease-in-out infinite;
}

@keyframes scaleAscendFast {
    0% {
        transform: translateY(15px) scale(0.9) rotate(-3deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-15px) scale(1.1) rotate(3deg);
        opacity: 1;
        filter: drop-shadow(0 5px 10px rgba(255, 107, 107, 0.4));
    }
    100% {
        transform: translateY(15px) scale(0.9) rotate(-3deg);
        opacity: 0.7;
    }
}

/* CHORDS & HARMONY - Chord strum with vibration */
.module-card[data-module="chords"] .module-icon {
    animation: chordStrum 2.5s ease-in-out infinite;
}

@keyframes chordStrum {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    10% {
        transform: rotate(-8deg) scale(1.05);
    }
    20% {
        transform: rotate(8deg) scale(1.05);
    }
    30% {
        transform: rotate(-4deg) scale(1.02);
    }
    40% {
        transform: rotate(4deg) scale(1.02);
    }
    50% {
        transform: rotate(0deg) scale(1);
    }
}

.module-card[data-module="chords"]:hover .module-icon {
    animation: chordStrumIntense 1s ease-in-out infinite;
}

@keyframes chordStrumIntense {
    0%, 100% {
        transform: rotate(0deg) scale(1.1);
        filter: brightness(1);
    }
    8% {
        transform: rotate(-12deg) scale(1.15);
        filter: brightness(1.2) drop-shadow(0 0 12px rgba(255, 195, 0, 0.6));
    }
    16% {
        transform: rotate(12deg) scale(1.15);
        filter: brightness(1.2) drop-shadow(0 0 12px rgba(255, 195, 0, 0.6));
    }
    24% {
        transform: rotate(-6deg) scale(1.12);
    }
    32% {
        transform: rotate(6deg) scale(1.12);
    }
    40% {
        transform: rotate(0deg) scale(1.1);
    }
}

/* Musical notes floating background effect */
.module-card::after {
    content: '♪ ♫ ♪';
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 4rem;
    opacity: 0.03;
    pointer-events: none;
    animation: floatNotes 4s ease-in-out infinite;
}

@keyframes floatNotes {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-10px, -10px) rotate(10deg);
    }
}

.module-card:hover::after {
    opacity: 0.08;
    animation: floatNotesFast 2s ease-in-out infinite;
}

@keyframes floatNotesFast {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    50% {
        transform: translate(-15px, -15px) rotate(15deg) scale(1.1);
    }
}

.module-card h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.module-card > p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.module-topics {
    list-style: none;
    margin-bottom: 1.5rem;
}

.module-topics li {
    padding: 0.5rem 0;
    color: var(--text-light);
    position: relative;
    padding-left: 1.5rem;
}

.module-topics li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 700;
}

.module-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--gradient-1);
    color: var(--white);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.module-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===================================
   MODAL
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-bg);
    color: var(--text-dark);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: rotate(90deg);
}

/* ===================================
   PRACTICE SECTION
   =================================== */
.practice-section {
    background: var(--white);
}

.practice-tools {
    display: grid;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-card > p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Fretboard */
.fretboard-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
}

.fretboard {
    background: linear-gradient(90deg, #D4A574 0%, #C9984C 100%);
    border-radius: 8px;
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
    min-height: 250px;
    position: relative;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Mobile touch optimizations */
    -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
    scroll-behavior: smooth; /* Smooth scrolling */
    touch-action: pan-x pan-y; /* Enable panning */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    user-select: none; /* Prevent text selection during touch */
    -webkit-user-select: none;
    -moz-user-select: none;
}

.fretboard-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Mobile Mode Selector (Dropdown) */
.mode-selector-mobile {
    display: none; /* Hidden on desktop */
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Desktop Mode Selector (Segmented Control) */
.mode-selector {
    display: flex;
    background: var(--light-bg);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--text-dark);
}

.mode-btn:hover {
    background: rgba(108, 92, 231, 0.1);
}

.mode-btn.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.mode-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Chord Selector Button */
.chord-selector-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 180px;
    justify-content: space-between;
}

.chord-selector-btn:hover {
    background: var(--light-bg);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dropdown-arrow {
    color: var(--primary-color);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.chord-selector-btn:hover .dropdown-arrow {
    transform: translateY(2px);
}

.fretboard-controls select {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 250px;
    min-width: 180px;
}

.fretboard-controls select:hover {
    background: var(--light-bg);
}

.pattern-select, .chord-select {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.chord-select {
    /* Width controlled by .fretboard-controls select */
}

.chord-select optgroup {
    font-weight: 700;
    font-style: normal;
    color: var(--primary-color);
    background: var(--light-bg);
    padding: 0.5rem 0;
}

.chord-select option {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.pattern-select:hover, .chord-select:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

/* ===== CHORD POSITION SELECTOR ===== */
.position-selector {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.position-selector-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.position-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
}

.position-btn {
    padding: 0.7rem 1.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: white;
    color: var(--text-color);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.position-btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 92, 231, 0.15);
}

.position-btn.active {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    color: white;
    border-color: #6C5CE7;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    transform: scale(1.05);
}

.position-btn.active:hover {
    background: linear-gradient(135deg, #5B4FD6, #9189ED);
    transform: scale(1.05) translateY(-2px);
}

.play-pattern-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.play-pattern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}

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

.play-instruction {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: fadeIn 0.3s ease;
}

.play-instruction.hidden {
    display: none;
}

.play-step {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.play-detail {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.play-note {
    font-size: 1rem;
    opacity: 0.9;
}

.fretboard-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 1rem;
    background: rgba(108, 92, 231, 0.05);
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.legend-color.highlight-color {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
}

.legend-color.root-color {
    background: linear-gradient(135deg, #FF6B6B, #FFA07A);
}

.legend-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
}

/* Metronome */
.metronome-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.bpm-display {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.bpm-label {
    font-size: 1.5rem;
    color: var(--text-light);
}

#bpm-slider {
    width: 100%;
    max-width: 400px;
    height: 8px;
    margin: 2rem auto;
    display: block;
    -webkit-appearance: none;
    background: var(--light-bg);
    border-radius: 10px;
    outline: none;
}

#bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--gradient-1);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.control-btn {
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--gradient-1);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.beat-indicator {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.beat {
    width: 20px;
    height: 20px;
    background: var(--light-bg);
    border-radius: 50%;
    transition: all 0.1s ease;
}

.beat.active {
    background: var(--gradient-1);
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.5);
}

/* Quiz */
.quiz-container {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.chord-diagram-display {
    background: var(--light-bg);
    min-height: 300px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.chord-diagram-visual {
    width: 100%;
    max-width: 400px;
}

.chord-name-label {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.chord-grid-container {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fret-markers {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-right: 0.5rem;
}

.fret-marker-spacer {
    height: 60px;
}

.fret-marker-number {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

.chord-strings-grid {
    display: flex;
    gap: 8px;
    flex: 1;
}

.chord-string-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.string-name {
    font-weight: 700;
    font-size: 1rem;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.string-status {
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.string-status.open {
    color: #27ae60;
}

.string-status.muted {
    color: #e74c3c;
}

.chord-fret-box {
    height: 50px;
    width: 100%;
    border: 2px solid #ddd;
    border-top: none;
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chord-fret-box:first-of-type {
    border-top: 4px solid #333;
}

.chord-fret-box.has-finger {
    background: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
}

.finger-position {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #6C5CE7;
}

.chord-difficulty-badge {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
}

.chord-difficulty-badge.beginner {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.chord-difficulty-badge.early-intermediate {
    background: linear-gradient(135deg, #3498db 0%, #5dade2 100%);
    color: white;
}

.chord-difficulty-badge.intermediate {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
}

.chord-difficulty-badge.advanced {
    background: linear-gradient(135deg, #e74c3c 0%, #ec7063 100%);
    color: white;
}

.chord-instructions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(108, 92, 231, 0.05);
    border-radius: 8px;
}

.instr-item {
    font-size: 0.85rem;
    color: var(--text-light);
}

.instr-item-fingers {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.instr-item-bar {
    font-size: 0.9rem;
    color: #e67e22;
    background: rgba(230, 126, 34, 0.1);
    padding: 0.5rem;
    border-radius: 6px;
    margin-top: 0.25rem;
}

/* Finger number labels on fretboard */
.finger-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #6C5CE7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border: 2px solid #6C5CE7;
}

.quiz-question {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quiz-btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: var(--light-bg);
    color: var(--text-dark);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-btn:hover {
    background: var(--secondary-color);
    color: var(--white);
}

.quiz-btn.correct {
    background: var(--success-color);
    color: var(--white);
    animation: pulse 0.5s ease;
}

.quiz-btn.incorrect {
    background: var(--accent-color);
    color: var(--white);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.quiz-score {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===================================
   PROGRESS SECTION
   =================================== */
.progress-section {
    background: linear-gradient(180deg, var(--light-bg) 0%, var(--white) 100%);
}

.progress-dashboard {
    max-width: 1000px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

.stat-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.skills-progress {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 3rem;
}

.skills-progress h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.skill-bar {
    margin-bottom: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.skill-percent {
    color: var(--primary-color);
}

.progress-track {
    width: 100%;
    height: 12px;
    background: var(--light-bg);
    border-radius: 10px;
    overflow: hidden;
}

.progress-value {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 10px;
    transition: width 1s ease;
}

.achievements-showcase {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.achievements-showcase h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

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

.achievement {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.achievement.unlocked {
    background: var(--gradient-1);
    color: var(--white);
    animation: unlockAchievement 0.8s ease-out;
}

@keyframes unlockAchievement {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(0deg);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===================================
   PRACTICE HISTORY
   =================================== */
.practice-history-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.practice-history-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.history-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.refresh-history-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-history-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.practice-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loading-message,
.no-history-message,
.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
}

.error-message {
    color: #e74c3c;
}

.practice-session-card {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.practice-session-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.session-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.session-title strong {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.session-type {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: capitalize;
    background: rgba(108, 92, 231, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
}

.session-date {
    font-size: 0.9rem;
    color: var(--text-light);
}

.session-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.session-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-value.good {
    color: var(--success-color);
}

.stat-value.medium {
    color: var(--warning-color);
}

.stat-value.low {
    color: #e74c3c;
}

.session-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.play-recording-btn {
    background: var(--gradient-1);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-recording-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.delete-session-btn {
    background: #e74c3c;
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-session-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.no-recording-text {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* Mobile responsiveness for practice history */
@media (max-width: 768px) {
    .session-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .session-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   CUSTOM MODALS & NOTIFICATIONS
   =================================== */

/* Custom Confirmation Modal */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.custom-modal.fade-out {
    animation: modalFadeOut 0.3s ease;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.custom-modal-header {
    background: var(--gradient-1);
    color: var(--white);
    padding: 1.5rem 2rem;
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.custom-modal-body {
    padding: 2rem;
}

.custom-modal-body p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.custom-modal-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--light-bg);
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-cancel {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--text-light);
}

.modal-btn-cancel:hover {
    background: var(--light-bg);
    border-color: var(--text-dark);
    transform: translateY(-2px);
}

.modal-btn-confirm {
    background: #e74c3c;
    color: var(--white);
}

.modal-btn-confirm:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.toast {
    background: var(--white);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.slide-out {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
}

.toast.success::before {
    background: var(--success-color);
}

.toast.error::before {
    background: #e74c3c;
}

.toast.info::before {
    background: var(--primary-color);
}

.toast-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: #e74c3c;
}

.toast.info .toast-icon {
    color: var(--primary-color);
}

.toast-content {
    flex: 1;
}

.toast-message {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--light-bg);
    color: var(--text-dark);
}

/* Mobile responsiveness for modals */
@media (max-width: 768px) {
    .custom-modal-content {
        width: 95%;
        margin: 1rem;
    }

    .custom-modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }

    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    background: var(--dark-bg);
    color: var(--white);
    padding: 3rem 20px;
    text-align: center;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-note {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* ===================================
   SONG SEARCH & CHORD PROGRESSION
   =================================== */

.song-search-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px solid #dee2e6;
}

.song-search-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.song-search-header h4 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.song-search-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.song-search-input-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.song-search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.2rem;
    font-size: 1rem;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.song-search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.search-icon {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    pointer-events: none;
    opacity: 0.5;
}

.song-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.song-card {
    background: white;
    padding: 1.2rem;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.song-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.15);
}

.song-header {
    margin-bottom: 0.8rem;
}

.song-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.song-artist {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.song-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.difficulty-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-badge.beginner {
    background: #d4edda;
    color: #155724;
}

.difficulty-badge.early-intermediate {
    background: #fff3cd;
    color: #856404;
}

.difficulty-badge.intermediate {
    background: #f8d7da;
    color: #721c24;
}

.chord-count, .capo-indicator {
    padding: 0.3rem 0.8rem;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-dark);
}

.capo-indicator {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    color: white;
    font-weight: 600;
}

.song-chords {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.6rem 0;
}

.chord-badge {
    padding: 0.4rem 0.7rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.more-chords {
    padding: 0.4rem 0.7rem;
    color: var(--text-light);
    font-size: 0.8rem;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 1rem;
}

/* Current Song Info */
.current-song-info {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
    border-radius: 12px;
    color: white;
}

.loaded-song-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.loaded-song-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.song-artist-name {
    font-size: 1rem;
    opacity: 0.9;
    font-style: italic;
}

.close-song-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-song-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.song-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.song-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.detail-label {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
}

.capo-highlight {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem;
    border-radius: 8px;
}

.strum-pattern {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Chord Progression Display */
.chord-progression-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
}

.progression-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.progression-header h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.progression-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.prog-nav-btn {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prog-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.prog-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chord-counter {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.progression-sequence {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.progression-chord {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}

.progression-chord:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.progression-chord.active {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    color: white;
    border-color: #6C5CE7;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}

/* Song Playback Controls */
.song-playback-controls {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.playback-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.playback-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    flex: 1;
    min-width: 100px;
}

.play-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.stop-btn {
    background: linear-gradient(135deg, #dc3545, #e83e4d);
    color: white;
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.loop-btn {
    background: linear-gradient(135deg, #6c757d, #868e96);
    color: white;
}

.loop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.loop-btn.active {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.bpm-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.bpm-control label {
    font-weight: 600;
    color: var(--text-dark);
    min-width: 120px;
}

.bpm-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #6C5CE7, #A29BFE);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6C5CE7;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
    transition: all 0.2s ease;
}

.bpm-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.6);
}

.bpm-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6C5CE7;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
    transition: all 0.2s ease;
}

.bpm-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.6);
}

.bpm-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    min-width: 50px;
    text-align: center;
    padding: 0.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 6px;
}

.strum-pattern-display {
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.strum-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.strum-visualization {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.strum-char {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 0.8rem;
    min-width: 40px;
    text-align: center;
    transition: all 0.3s ease;
}

.strum-arrow {
    color: var(--text-dark);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 6px;
    border: 2px solid #dee2e6;
}

.strum-char.active {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    color: white;
    border-color: #6C5CE7;
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.5);
}

.strum-space {
    color: transparent;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    /* General mobile adjustments */
    .container {
        padding: 0 15px;
        max-width: 100vw; /* Ensure no overflow */
    }

    section {
        padding: 3rem 0;
        overflow-x: hidden; /* Prevent section overflow */
    }

    /* Practice section mobile fixes - PROPER MOBILE LAYOUT */
    .practice-section {
        overflow-x: hidden;
    }

    .practice-tools {
        padding: 0;
        max-width: 100%;
        overflow-x: hidden;
        /* NO scaling - proper mobile redesign */
    }

    .tool-card {
        padding: 0.5rem;
        margin: 0;
        border-radius: 12px;
        overflow-x: hidden;
    }

    .tool-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }

    .tool-card > p {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    /* Song search section mobile - STRICT WIDTH CONTROL */
    .song-search-section {
        overflow-x: hidden;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .song-search-header {
        max-width: 100%;
        padding: 0 0.5rem;
    }

    .song-search-header h4 {
        font-size: 1.1rem;
        word-wrap: break-word;
    }

    .song-search-header p {
        font-size: 0.8rem;
        word-wrap: break-word;
    }

    .song-filters-container {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .song-search-input-container {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        padding: 0;
    }

    .song-search-input {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    /* Ensure song cards don't overflow */
    .songs-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
        max-width: 100%;
    }

    .song-card {
        min-height: 360px;
        max-height: none;
        width: 100%; /* Explicit width */
        max-width: 100%; /* Prevent overflow */
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: auto;
        min-height: 50px; /* Touch-friendly */
    }

    .hero-content {
        padding: 0 1rem;
    }

    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 2rem;
        padding: 0 1rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 2rem 1.5rem;
        margin: 20px;
    }

    /* ===== FRETBOARD MOBILE OPTIMIZATIONS ===== */
    .tool-card {
        padding: 1rem;
        overflow-x: visible; /* Allow fretboard to scroll independently */
    }

    .fretboard-container {
        padding: 1rem;
        overflow-x: visible; /* Ensure container doesn't clip scrolling */
    }

    .fretboard {
        padding: 1rem 0.5rem;
        min-height: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    /* Override inline fretboard styles for mobile - ultra compact */
    .fretboard-wrapper {
        padding: 8px !important;
        width: fit-content;
        min-width: 100%;
    }

    .fret-cell {
        width: 35px !important;
        height: 30px !important;
    }

    .fret-number {
        width: 35px !important;
        font-size: 0.65rem !important;
    }

    .string-name-in-nut {
        font-size: 0.85rem !important;
    }

    .note-label {
        font-size: 0.7rem !important;
    }

    .fret-marker {
        width: 8px !important;
        height: 8px !important;
    }

    /* Add horizontal scroll hint */
    .fretboard::after {
        content: "← Scroll →";
        display: block;
        text-align: center;
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.6);
        margin-top: 0.5rem;
        font-weight: 600;
    }

    /* Make fretboard controls stack vertically and fill width on tablet */
    .fretboard-controls {
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }

    .pattern-select, .chord-select {
        width: 100%;
        min-width: auto;
        padding: 1rem 1.5rem;
        font-size: 1.05rem;
    }

    .play-pattern-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
        font-size: 1.05rem;
    }

    /* Position selector optimizations for tablet */
    .position-selector {
        padding: 1rem;
        margin: 1rem 0;
    }

    .position-selector-label {
        font-size: 0.95rem;
    }

    .position-btn {
        padding: 0.8rem 1.1rem;
        font-size: 0.85rem;
        min-height: 44px; /* Touch target minimum */
    }

    /* ===== MODE SELECTOR MOBILE OPTIMIZATIONS ===== */
    /* Show mobile dropdown, hide desktop buttons */
    .mode-selector-mobile {
        display: block;
    }

    .mode-selector-desktop {
        display: none;
    }

    /* Song actions mobile */
    .song-actions {
        flex-direction: column;
        gap: 0.75rem;
        max-width: 100%;
        padding: 0;
    }

    /* ===== METRONOME MOBILE OPTIMIZATIONS ===== */
    .metronome-container {
        padding: 1.5rem 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .bpm-display {
        font-size: 3.5rem;
        max-width: 100%;
    }

    .bpm-label {
        font-size: 1.3rem;
    }

    #bpm-slider {
        height: 12px; /* Taller track for easier touch */
        margin: 1.5rem auto;
        max-width: 100%;
        width: 100%;
    }

    #bpm-slider::-webkit-slider-thumb {
        width: 32px; /* Bigger thumb for touch */
        height: 32px;
    }

    #bpm-slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
    }

    .control-btn {
        padding: 1.2rem 3.5rem;
        font-size: 1.15rem;
        min-height: 56px; /* Larger touch target */
    }

    .beat {
        width: 24px;
        height: 24px;
    }

    /* ===== CHORD CHALLENGE MOBILE OPTIMIZATIONS ===== */
    .quiz-container {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .chord-diagram-display {
        padding: 1rem;
        min-height: auto;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chord-diagram-visual {
        max-width: 100%;
        width: auto;
        margin: 0 auto;
    }

    .chord-grid-container {
        padding: 1rem;
        gap: 0.25rem;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .quiz-question {
        font-size: 1rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
    }

    .quiz-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-width: 100%;
    }

    .quiz-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        min-height: 50px;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* ===== MOBILE PHONE FRETBOARD OPTIMIZATIONS ===== */
    .fretboard-container {
        padding: 0.5rem;
        margin: 0 -1rem; /* Negative margin to use full screen width */
    }

    .fretboard {
        padding: 0.5rem;
        border-radius: 0;
    }

    /* Further reduce fretboard cell sizes for very small screens */
    .fret-cell {
        width: 36px !important;
        height: 32px !important;
    }

    .fret-number {
        width: 36px !important;
        font-size: 0.65rem !important;
    }

    .string-name-in-nut {
        font-size: 0.9rem !important;
    }

    .note-label {
        font-size: 0.7rem !important;
    }

    .fret-marker {
        width: 8px !important;
        height: 8px !important;
    }

    .fretboard-wrapper {
        padding: 8px !important;
    }

    /* Optimize fretboard controls for small screens */
    .fretboard-controls {
        gap: 0.6rem;
        padding: 0 0.5rem;
    }

    .pattern-select, .chord-select {
        padding: 1.1rem 1rem;
        font-size: 1rem;
        border-width: 3px; /* Thicker border for visibility */
        min-height: 50px; /* Minimum touch target */
    }

    .play-pattern-btn {
        padding: 1.1rem 2rem;
        font-size: 1rem;
        min-height: 50px;
    }

    /* Position selector - make buttons full-width stacked on mobile */
    .position-selector {
        padding: 0.8rem;
        margin: 0.5rem 0;
    }

    .position-selector-label {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }

    .position-buttons {
        flex-direction: column;
        gap: 0.6rem;
        width: 100%;
    }

    .position-btn {
        width: 100%;
        padding: 1rem;
        font-size: 0.95rem;
        min-height: 50px; /* Larger touch target */
        border-width: 3px;
    }

    /* ===== MOBILE PHONE METRONOME OPTIMIZATIONS ===== */
    .metronome-container {
        padding: 1rem 0.5rem;
    }

    .bpm-display {
        font-size: 3rem;
        flex-wrap: wrap;
    }

    .bpm-label {
        font-size: 1.1rem;
    }

    /* Larger slider for easier mobile control */
    #bpm-slider {
        height: 16px; /* Even taller on mobile */
        margin: 1.5rem 0.5rem;
        max-width: 100%;
    }

    #bpm-slider::-webkit-slider-thumb {
        width: 40px; /* Extra large thumb for mobile */
        height: 40px;
    }

    #bpm-slider::-moz-range-thumb {
        width: 40px;
        height: 40px;
    }

    /* Large, easy-to-tap control button */
    .control-btn {
        width: 100%;
        padding: 1.3rem 2rem;
        font-size: 1.2rem;
        min-height: 60px; /* Extra large touch target */
        border-radius: 12px;
    }

    .beat-indicator {
        margin-top: 1.5rem;
        gap: 0.8rem;
    }

    .beat {
        width: 28px; /* Larger beat indicators */
        height: 28px;
    }

    /* ===== TECHNIQUE DEMO MOBILE OPTIMIZATIONS ===== */
    .technique-demo {
        padding: 1rem;
        margin: 1rem 0;
    }

    .demo-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .picking-sequence {
        gap: 0.6rem;
    }

    .pick-stroke {
        width: 70px;
        height: 70px;
        font-size: 2rem;
        min-height: 44px; /* Touch target */
        min-width: 44px;
    }

    .pick-stroke.chord {
        width: 75px;
        height: 75px;
        font-size: 1.5rem;
    }

    .pick-stroke.note {
        width: 65px;
        height: 65px;
        font-size: 1.4rem;
    }

    .alternate-picking-demo {
        padding: 1rem;
    }

    .rhythm-indicator {
        width: 90%;
        height: 6px;
        margin: 1.5rem auto;
    }

    .technique-note {
        font-size: 0.85rem;
    }

    /* ===== MOBILE SONG PLAYBACK CONTROLS ===== */
    .song-playback-controls {
        padding: 1rem;
    }

    .playback-buttons {
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }

    .playback-btn {
        width: 100%;
        min-height: 50px;
        font-size: 1.05rem;
        padding: 1rem;
    }

    .bpm-control {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        padding: 1rem;
    }

    .bpm-control label {
        min-width: auto;
        text-align: center;
    }

    .bpm-slider {
        height: 12px;
    }

    .bpm-slider::-webkit-slider-thumb {
        width: 32px;
        height: 32px;
    }

    .bpm-slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
    }

    .bpm-value {
        font-size: 1.3rem;
        padding: 0.8rem;
    }

    .strum-pattern-display {
        padding: 1rem;
    }

    .strum-label {
        text-align: center;
        margin-bottom: 1rem;
    }

    .strum-char {
        font-size: 1.3rem;
        padding: 0.6rem 0.7rem;
        min-width: 36px;
        min-height: 44px;
    }

    .progression-header {
        flex-direction: column;
        gap: 0.8rem;
    }

    .progression-controls {
        width: 100%;
        justify-content: space-between;
    }

    .prog-nav-btn {
        min-height: 50px;
        padding: 0.8rem 1rem;
    }

    .progression-chord {
        padding: 0.9rem 1.2rem;
        min-height: 50px;
        font-size: 1.05rem;
    }
}

/* ===================================
   TECHNIQUE DEMONSTRATIONS
   =================================== */
.technique-demo {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.demo-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* ===== PICK GRIP DEMONSTRATION ===== */
.pick-grip-demo {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 2rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.hand-outline {
    position: relative;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #ffe4c4 0%, #ffd4a3 100%);
    border-radius: 60% 40% 40% 60%;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    animation: subtleRotate 4s ease-in-out infinite;
}

@keyframes subtleRotate {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.thumb {
    position: absolute;
    top: 50px;
    left: 10px;
    width: 50px;
    height: 80px;
    background: linear-gradient(135deg, #ffd4a3 0%, #ffb366 100%);
    border-radius: 50% 50% 30% 50%;
    transform: rotate(-20deg);
    box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.1);
    animation: thumbPressRelease 3s ease-in-out infinite;
}

@keyframes thumbPressRelease {
    0%, 100% { transform: rotate(-20deg) translateY(0); }
    50% { transform: rotate(-22deg) translateY(3px); }
}

.index-finger {
    position: absolute;
    bottom: 40px;
    right: 15px;
    width: 50px;
    height: 90px;
    background: linear-gradient(135deg, #ffd4a3 0%, #ffb366 100%);
    border-radius: 40% 40% 50% 50%;
    transform: rotate(15deg);
    box-shadow: inset 5px -5px 10px rgba(0, 0, 0, 0.1);
    animation: fingerCurl 3s ease-in-out infinite;
}

@keyframes fingerCurl {
    0%, 100% { transform: rotate(15deg) translateY(0); }
    50% { transform: rotate(18deg) translateY(-2px); }
}

.pick-triangle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 45px solid #ff6b6b;
    filter: drop-shadow(0 4px 8px rgba(255, 107, 107, 0.4));
    animation: pickHighlight 2s ease-in-out infinite;
}

@keyframes pickHighlight {
    0%, 100% { filter: drop-shadow(0 4px 8px rgba(255, 107, 107, 0.4)); }
    50% { filter: drop-shadow(0 6px 12px rgba(255, 107, 107, 0.8)) brightness(1.2); }
}

.demo-labels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.label {
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    color: var(--text-dark);
    border-left: 4px solid var(--primary-color);
    animation: labelFadeIn 0.6s ease forwards;
    opacity: 0;
}

.label-thumb { animation-delay: 0.2s; }
.label-index { animation-delay: 0.4s; }
.label-pick { animation-delay: 0.6s; border-left-color: #ff6b6b; }

@keyframes labelFadeIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== PICKING MOTION DEMONSTRATION ===== */
.picking-motion-demo {
    position: relative;
    padding: 3rem 2rem;
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
}

.guitar-strings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 2rem;
}

.string {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #ccc 0%, #888 50%, #ccc 100%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.string.active-string {
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff8787 50%, #ff6b6b 100%);
    animation: stringVibrate 1.5s ease-in-out infinite;
}

@keyframes stringVibrate {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-3px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(3px); }
}

.pick-hand {
    position: absolute;
    top: 50%;
    right: 20%;
    width: 80px;
    height: 120px;
}

.wrist {
    width: 50px;
    height: 60px;
    background: linear-gradient(135deg, #ffe4c4 0%, #ffd4a3 100%);
    border-radius: 40%;
    position: absolute;
    top: 0;
    right: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform-origin: center bottom;
    animation: wristRotate 3s ease-in-out infinite;
}

@keyframes wristRotate {
    0%, 100% { transform: rotate(-10deg); }
    25% { transform: rotate(-25deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(5deg); }
}

.pick-moving {
    position: absolute;
    top: 60px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid #ff6b6b;
    filter: drop-shadow(0 4px 6px rgba(255, 107, 107, 0.5));
    animation: pickUpDown 3s ease-in-out infinite;
}

@keyframes pickUpDown {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(-15deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(30px) rotate(15deg); }
}

.motion-arrow {
    position: absolute;
    right: -30px;
    font-size: 2.5rem;
    font-weight: 700;
    opacity: 0;
}

.motion-arrow.downstroke {
    top: 30px;
    color: #6C5CE7;
    animation: showDownstroke 3s ease-in-out infinite;
}

.motion-arrow.upstroke {
    top: 90px;
    color: #A29BFE;
    animation: showUpstroke 3s ease-in-out infinite;
}

@keyframes showDownstroke {
    0%, 20%, 50%, 100% { opacity: 0; }
    21%, 49% { opacity: 1; }
}

@keyframes showUpstroke {
    0%, 70%, 100% { opacity: 0; }
    71%, 99% { opacity: 1; }
}

.motion-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.label-down, .label-up {
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.label-down { border-left: 4px solid #6C5CE7; }
.label-up { border-left: 4px solid #A29BFE; }

/* ===== ALTERNATE PICKING DEMONSTRATION ===== */
.alternate-picking-demo {
    text-align: center;
    padding: 2rem;
}

.picking-sequence {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.pick-stroke {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    background: white;
    border: 3px solid #dee2e6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0.4;
}

.pick-stroke span {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    color: var(--text-light);
}

.pick-stroke.down {
    color: #6C5CE7;
    border-color: #6C5CE7;
}

.pick-stroke.up {
    color: #A29BFE;
    border-color: #A29BFE;
}

.pick-stroke.active {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4);
    animation: strokePulse 2s ease-in-out infinite;
}

@keyframes strokePulse {
    0% { transform: scale(1.15); box-shadow: 0 8px 20px rgba(108, 92, 231, 0.4); }
    25% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1); opacity: 0.4; }
    75% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.15); opacity: 1; box-shadow: 0 8px 20px rgba(162, 155, 254, 0.4); }
}

/* Sequence animation for all strokes */
.picking-sequence .pick-stroke:nth-child(1) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 0s; }
.picking-sequence .pick-stroke:nth-child(2) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 1s; }
.picking-sequence .pick-stroke:nth-child(3) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 2s; }
.picking-sequence .pick-stroke:nth-child(4) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 3s; }

@keyframes activateStroke {
    0%, 25%, 100% { opacity: 0.4; transform: scale(1); }
    5%, 20% { opacity: 1; transform: scale(1.15); box-shadow: 0 8px 20px rgba(108, 92, 231, 0.5); }
}

.rhythm-indicator {
    width: 80%;
    height: 4px;
    background: #dee2e6;
    margin: 2rem auto;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.rhythm-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, #6C5CE7, #A29BFE);
    border-radius: 2px;
    animation: rhythmProgress 4s linear infinite;
}

@keyframes rhythmProgress {
    0% { left: 0%; }
    100% { left: 100%; }
}

.technique-note {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 1rem;
}

/* ===== STRUMMING PATTERN ANIMATIONS ===== */

/* Pattern 1: Basic (4 beats) - uses default 4-child animation above */
.pattern-basic .pick-stroke:nth-child(1) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 0s; }
.pattern-basic .pick-stroke:nth-child(2) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 1s; }
.pattern-basic .pick-stroke:nth-child(3) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 2s; }
.pattern-basic .pick-stroke:nth-child(4) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 3s; }

/* Pattern 2: Standard Rock (6 strokes in 4 beats) */
.pattern-rock .pick-stroke:nth-child(1) { animation: activateStroke 6s ease-in-out infinite; animation-delay: 0s; }
.pattern-rock .pick-stroke:nth-child(2) { animation: activateStroke 6s ease-in-out infinite; animation-delay: 1s; }
.pattern-rock .pick-stroke:nth-child(3) { animation: activateStroke 6s ease-in-out infinite; animation-delay: 2s; }
.pattern-rock .pick-stroke:nth-child(4) { animation: activateStroke 6s ease-in-out infinite; animation-delay: 3s; }
.pattern-rock .pick-stroke:nth-child(5) { animation: activateStroke 6s ease-in-out infinite; animation-delay: 4s; }
.pattern-rock .pick-stroke:nth-child(6) { animation: activateStroke 6s ease-in-out infinite; animation-delay: 5s; }

/* Pattern 3: Folk (5 strokes in 4 beats) */
.pattern-folk .pick-stroke:nth-child(1) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 0s; }
.pattern-folk .pick-stroke:nth-child(2) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 1s; }
.pattern-folk .pick-stroke:nth-child(3) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 2s; }
.pattern-folk .pick-stroke:nth-child(4) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 3s; }
.pattern-folk .pick-stroke:nth-child(5) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 4s; }

/* Rhythm indicator timing for each pattern */
.pattern-basic + .rhythm-indicator::after { animation: rhythmProgress 4s linear infinite; }
.pattern-rock + .rhythm-indicator::after { animation: rhythmProgress 6s linear infinite; }
.pattern-folk + .rhythm-indicator::after { animation: rhythmProgress 5s linear infinite; }

/* ===== CHORD PROGRESSION ANIMATIONS ===== */

/* Style for chord boxes (larger, more prominent than strokes) */
.pick-stroke.chord {
    width: 110px;
    height: 110px;
    font-size: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #6C5CE7;
    color: #6C5CE7;
    font-weight: 800;
}

/* Pop Progression (4 chords, 4 beats) */
.progression-pop .pick-stroke:nth-child(1) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 0s; }
.progression-pop .pick-stroke:nth-child(2) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 1s; }
.progression-pop .pick-stroke:nth-child(3) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 2s; }
.progression-pop .pick-stroke:nth-child(4) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 3s; }

/* Rock Progression (4 chords, 4 beats) */
.progression-rock .pick-stroke:nth-child(1) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 0s; }
.progression-rock .pick-stroke:nth-child(2) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 1s; }
.progression-rock .pick-stroke:nth-child(3) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 2s; }
.progression-rock .pick-stroke:nth-child(4) { animation: activateStroke 4s ease-in-out infinite; animation-delay: 3s; }

/* Blues Progression (12 bars) */
.progression-blues .pick-stroke:nth-child(1) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 0s; }
.progression-blues .pick-stroke:nth-child(2) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 1s; }
.progression-blues .pick-stroke:nth-child(3) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 2s; }
.progression-blues .pick-stroke:nth-child(4) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 3s; }
.progression-blues .pick-stroke:nth-child(5) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 4s; }
.progression-blues .pick-stroke:nth-child(6) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 5s; }
.progression-blues .pick-stroke:nth-child(7) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 6s; }
.progression-blues .pick-stroke:nth-child(8) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 7s; }
.progression-blues .pick-stroke:nth-child(9) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 8s; }
.progression-blues .pick-stroke:nth-child(10) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 9s; }
.progression-blues .pick-stroke:nth-child(11) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 10s; }
.progression-blues .pick-stroke:nth-child(12) { animation: activateStroke 12s ease-in-out infinite; animation-delay: 11s; }

/* Rhythm indicator timing for chord progressions */
.progression-pop + .rhythm-indicator::after { animation: rhythmProgress 4s linear infinite; }
.progression-rock + .rhythm-indicator::after { animation: rhythmProgress 4s linear infinite; }
.progression-blues + .rhythm-indicator::after { animation: rhythmProgress 12s linear infinite; }

/* ===== SCALE PATTERN ANIMATIONS ===== */

/* Style for note boxes (musical notes in scales) */
.pick-stroke.note {
    position: relative; /* Ensure proper positioning, not absolute */
    width: 90px;
    height: 90px;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #74b9ff 0%, #a29bfe 100%);
    border: 3px solid #0984e3;
    color: #2d3436;
    font-weight: 800;
}

/* Minor scale notes - darker color scheme */
.pick-stroke.note.minor {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    border: 3px solid #6c5ce7;
    color: #ffffff;
}

/* Pentatonic scale notes - special color scheme */
.pick-stroke.note.penta {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
    border: 3px solid #00b894;
    color: #2d3436;
}

/* Major Scale (8 notes) */
.scale-major .pick-stroke:nth-child(1) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 0s; }
.scale-major .pick-stroke:nth-child(2) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 1s; }
.scale-major .pick-stroke:nth-child(3) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 2s; }
.scale-major .pick-stroke:nth-child(4) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 3s; }
.scale-major .pick-stroke:nth-child(5) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 4s; }
.scale-major .pick-stroke:nth-child(6) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 5s; }
.scale-major .pick-stroke:nth-child(7) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 6s; }
.scale-major .pick-stroke:nth-child(8) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 7s; }

/* Minor Scale (8 notes) */
.scale-minor .pick-stroke:nth-child(1) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 0s; }
.scale-minor .pick-stroke:nth-child(2) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 1s; }
.scale-minor .pick-stroke:nth-child(3) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 2s; }
.scale-minor .pick-stroke:nth-child(4) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 3s; }
.scale-minor .pick-stroke:nth-child(5) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 4s; }
.scale-minor .pick-stroke:nth-child(6) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 5s; }
.scale-minor .pick-stroke:nth-child(7) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 6s; }
.scale-minor .pick-stroke:nth-child(8) { animation: activateStroke 8s ease-in-out infinite; animation-delay: 7s; }

/* Pentatonic Scale (5 notes) */
.scale-pentatonic .pick-stroke:nth-child(1) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 0s; }
.scale-pentatonic .pick-stroke:nth-child(2) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 1s; }
.scale-pentatonic .pick-stroke:nth-child(3) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 2s; }
.scale-pentatonic .pick-stroke:nth-child(4) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 3s; }
.scale-pentatonic .pick-stroke:nth-child(5) { animation: activateStroke 5s ease-in-out infinite; animation-delay: 4s; }

/* Rhythm indicator timing for scales */
.scale-major + .rhythm-indicator::after { animation: rhythmProgress 8s linear infinite; }
.scale-minor + .rhythm-indicator::after { animation: rhythmProgress 8s linear infinite; }
.scale-pentatonic + .rhythm-indicator::after { animation: rhythmProgress 5s linear infinite; }

/* ===================================
   UTILITY CLASSES
   =================================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* ===== CHORD MODAL ===== */
.chord-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chord-modal.active {
    display: flex;
    opacity: 1;
}

.chord-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chord-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--light-bg);
    background: var(--gradient-1);
    color: white;
}

.chord-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chord-modal-body {
    padding: 1.5rem 2rem;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.chord-category {
    margin-bottom: 2rem;
}

.category-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-bg);
}

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

.chord-btn {
    padding: 12px 16px;
    background: white;
    border: 2px solid var(--light-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}

.chord-btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chord-btn.selected {
    background: var(--gradient-1);
    border-color: var(--primary-color);
    color: white;
}

/* Root Note Grid - larger buttons for better visibility */
.root-note-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 500px;
    margin: 0 auto;
}

.root-note-grid .chord-btn {
    padding: 20px;
    font-size: 1.2rem;
}

/* Tuning Grid and Buttons */
.tuning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.tuning-btn {
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid var(--light-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tuning-btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tuning-btn.selected {
    background: var(--gradient-1);
    border-color: var(--primary-color);
    color: white;
}

.tuning-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: inherit;
}

.tuning-notes {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    color: inherit;
    letter-spacing: 0.5px;
}

/* Selector Icon */
.selector-icon {
    font-size: 1.2rem;
    margin-right: 0.25rem;
}

/* ===================================
   SONG LIBRARY
   =================================== */

.song-library-section {
    margin-top: 3rem;
    padding: 2rem 0;
}

.song-filters {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--light-bg);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gradient-1);
    border-color: var(--primary-color);
    color: white;
}

.songs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.song-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.song-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.song-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.song-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.song-difficulty-badge {
    /* Styles moved to .song-card .song-difficulty-badge */
}

.song-header {
    padding-right: 2rem;
    margin-bottom: 0.5rem;
}

.song-title {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
    padding-right: 1.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.song-artist {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

.song-card-artist {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0.5rem 0;
    font-style: italic;
}

.song-card-description {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin: 1rem 0;
    line-height: 1.5;
}

.song-card-meta {
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 6px;
}

.song-card-chords {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.song-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-bg);
}

.song-tempo, .song-category {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===================================
   SONG PLAYER
   =================================== */

.song-player {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-color);
}

.song-player-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
}

.song-info {
    flex: 1;
}

.song-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.song-artist {
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
    margin: 0 0 0.75rem 0;
}

.song-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.song-meta span {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.close-song-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.close-song-btn:hover {
    color: var(--text-dark);
    transform: scale(1.1);
}

.chord-progression {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.chord-box {
    min-width: 120px;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-align: center;
}

.chord-box.active {
    background: var(--gradient-1);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.chord-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.chord-beats {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.beat-indicator-bar {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.beat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.beat-dot.active {
    background: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.chord-box:not(.active) .beat-dot.active {
    background: var(--primary-color);
}

.song-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.song-control-btn {
    padding: 0.75rem 1.25rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.song-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

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

.play-pause-btn {
    padding: 0.75rem 2rem;
}

.play-icon {
    display: inline-block;
    width: 20px;
}

/* Responsive adjustments for song library */
@media (max-width: 768px) {
    .songs-grid {
        grid-template-columns: 1fr;
    }

    .chord-progression {
        gap: 0.5rem;
    }

    .chord-box {
        min-width: 100px;
        padding: 0.75rem;
    }

    .song-controls {
        gap: 0.5rem;
    }

    .song-control-btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}
}

/* ===================================
   SONG FILTERS & ENHANCED BROWSER
   =================================== */

.song-filters-container {
    margin-bottom: 1.5rem;
}

.song-quick-filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 12px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
    min-width: 90px;
}

.filter-pill {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--light-bg);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.filter-pill:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-pill.active {
    background: var(--gradient-1);
    border-color: var(--primary-color);
    color: white;
}

/* Mobile Filter Drawer */
.mobile-filter-toggle {
    display: none; /* Hidden on desktop */
    width: 100%;
    padding: 1rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin: 1rem 0;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-filter-toggle:active {
    transform: scale(0.98);
}

.filter-badge {
    display: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

.filter-drawer-close {
    display: none; /* Hidden on desktop, shown in mobile drawer */
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
    line-height: 1;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.filter-drawer-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.song-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.feeling-lucky-btn {
    padding: 1rem 2rem;
    background: var(--gradient-2);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.feeling-lucky-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.feeling-lucky-btn:active {
    transform: translateY(0) scale(0.98);
}

.sort-dropdown {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-dropdown:hover {
    background: var(--light-bg);
    border-color: var(--secondary-color);
}

.sort-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

/* Enhanced Song Cards */
.song-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: visible;
    display: flex;
    flex-direction: column;
    min-height: 380px;
    max-height: 600px;
}

.song-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.song-card .difficulty-badge,
.song-card .song-difficulty-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    z-index: 10;
    font-size: 0;
    padding: 0;
    text-indent: -9999px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.song-card .difficulty-badge.beginner,
.song-card .song-difficulty-badge.beginner {
    background: #4CAF50;
}

.song-card .difficulty-badge.early-intermediate,
.song-card .song-difficulty-badge.early-intermediate {
    background: #FF9800;
}

.song-card .difficulty-badge.intermediate,
.song-card .song-difficulty-badge.intermediate {
    background: #F44336;
}

.song-card .difficulty-badge.advanced,
.song-card .song-difficulty-badge.advanced {
    background: #9C27B0;
}

.streaming-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
    padding-top: 0.75rem;
}

/* Push streaming links to bottom when there's no Spotify preview section */
.song-card:not(:has(.spotify-preview-section)) .streaming-links {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--light-bg);
}

.streaming-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    opacity: 0.7;
}

.streaming-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid transparent;
}

.streaming-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.streaming-btn.spotify {
    background: #1DB954;
    color: white;
}

.streaming-btn.spotify:hover {
    background: #1ed760;
    border-color: #1DB954;
}

.streaming-btn.apple-music {
    background: linear-gradient(135deg, #FA243C 0%, #FF6B7A 100%);
    color: white;
}

.streaming-btn.apple-music:hover {
    background: linear-gradient(135deg, #ff2d47 0%, #ff7d8c 100%);
    border-color: #FA243C;
}

.streaming-btn.amazon-music {
    background: linear-gradient(135deg, #00A8E1 0%, #232F3E 100%);
    color: white;
}

.streaming-btn.amazon-music:hover {
    background: linear-gradient(135deg, #00bbff 0%, #2d3d52 100%);
    border-color: #00A8E1;
}

/* Spotify Preview Section */
.spotify-preview-section {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--light-bg);
}

.spotify-preview-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    height: 44px;
    background: #1DB954;
    color: white;
    border: none;
    border-radius: 24px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.spotify-preview-toggle:hover {
    background: #1ed760;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.spotify-preview-toggle.active {
    background: var(--gradient-1);
}

.spotify-preview-toggle svg {
    flex-shrink: 0;
}

.spotify-embed-container {
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlightCard {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }
}

.song-genre-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.genre-tag {
    padding: 0.25rem 0.6rem;
    background: var(--light-bg);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

.song-count-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gradient-1);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.song-difficulty-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    z-index: 5;
}

.song-difficulty-badge.beginner {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.song-difficulty-badge.early-intermediate {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.song-difficulty-badge.intermediate {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
}

.song-key {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 600;
    opacity: 0.8;
}

.song-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.song-tag {
    padding: 0.3rem 0.7rem;
    background: var(--light-bg);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: capitalize;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Show mobile filter toggle button */
    .mobile-filter-toggle {
        display: block;
    }

    /* Show close button in mobile drawer */
    .filter-drawer-close {
        display: flex;
    }

    /* Transform filters into slide-up drawer */
    .song-quick-filters {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 70vh;
        overflow-y: auto;
        background: white;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
        z-index: 1100;
        padding: 3rem 1.5rem 1.5rem;
        margin: 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: auto; /* Ensure drawer can receive clicks */
        opacity: 1; /* Ensure drawer is fully visible */
    }

    .song-quick-filters.active {
        transform: translateY(0);
    }

    /* Backdrop overlay when drawer is open */
    body.filter-drawer-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1099;
        pointer-events: none; /* Don't block clicks to drawer */
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-label {
        min-width: auto;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .filter-pill {
        min-height: 44px; /* Touch-friendly */
        padding: 0.75rem 1.25rem;
    }

    .feeling-lucky-btn {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .sort-dropdown {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .mobile-filter-toggle {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Mobile-specific card adjustments */
    .song-card {
        min-height: 360px;
        max-height: none;
    }

    .song-title {
        font-size: 1.2rem;
        padding-right: 2rem;
    }

    .song-meta {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    .song-chords {
        gap: 0.4rem;
    }

    .chord-badge {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .song-tags {
        gap: 0.3rem;
    }

    .song-tag {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }

    .spotify-preview-toggle {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }

    .streaming-btn {
        width: 32px;
        height: 32px;
    }

    .streaming-label {
        font-size: 0.75rem;
    }

    /* Song grid - single column on mobile */
    .songs-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Search section adjustments */
    .song-browser-section {
        padding: 2rem 0;
    }

    .song-search-container {
        padding: 1rem;
    }

    #song-search-input {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    /* Filter pills - wrap and stack better */
    .filter-pill {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Action buttons */
    .song-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .feeling-lucky-btn,
    .sort-dropdown {
        width: 100%;
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
    }
}

/* Tablet styles (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .songs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .song-card {
        min-height: 380px;
    }
}

/* ========================================
   MOBILE MENU TOGGLE
   ======================================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger animation when active */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 60px);
        background: white;
        flex-direction: column;
        padding: 2rem 1rem;
        padding-bottom: 3rem; /* Extra padding for dropdown */
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scroll-behavior: smooth;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        width: 100%;
        margin: 0;
    }

    .nav-link {
        padding: 1rem;
        width: 100%;
        text-align: left;
        display: block;
        border-radius: 8px;
    }

    .nav-link:hover {
        background: var(--light-bg);
    }

    .nav-link.active {
        background: var(--primary-color);
        color: white;
    }

    /* Mobile user dropdown styles */
    .nav-user {
        width: 100%;
        margin-top: 1rem;
        margin-bottom: 2rem; /* Extra space for dropdown */
        position: relative !important;
        overflow: visible !important;
    }

    .user-profile-btn {
        width: 100%;
        justify-content: space-between;
        padding: 1rem;
        background: var(--primary-color);
        border-color: var(--primary-color);
    }

    .user-profile-btn #user-name {
        color: var(--white);
        font-weight: 600;
    }

    .user-profile-btn .dropdown-arrow {
        color: var(--white);
    }

    .user-dropdown {
        position: static !important;
        width: 100% !important;
        margin-top: 0.5rem;
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        max-width: none !important;
        right: auto !important;
        top: auto !important;
        overflow: visible !important;
        min-height: 200px !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        background: var(--white) !important;
        z-index: 1 !important;
    }

    /* Ensure dropdown content is visible when toggled */
    .user-dropdown[style*="display: block"],
    .user-dropdown[style*="display:block"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        max-height: none !important;
    }

    .user-dropdown[style*="display: none"],
    .user-dropdown[style*="display:none"] {
        display: none !important;
    }

    .user-dropdown-header {
        padding: 1rem;
        display: flex !important;
        background: var(--gradient-1);
        color: var(--white);
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        display: flex !important;
    }

    .user-info {
        display: block !important;
    }

    .user-info h4 {
        font-size: 1rem;
        display: block !important;
        margin: 0 !important;
    }

    .user-level {
        font-size: 0.75rem;
        display: block !important;
    }

    .user-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 1rem;
        display: grid !important;
        background: var(--light-bg);
    }

    .user-stat {
        padding: 0.75rem;
        min-height: 70px;
        display: flex !important;
        background: var(--white);
    }

    .stat-icon {
        font-size: 1.25rem;
        display: block !important;
    }

    .stat-info {
        display: flex !important;
        flex-direction: column;
    }

    .stat-value {
        font-size: 1.25rem;
        display: block !important;
    }

    .stat-label {
        font-size: 0.65rem;
        display: block !important;
    }

    .user-dropdown-divider {
        margin: 0.75rem 1rem;
        display: block !important;
    }

    .dropdown-profile-link {
        padding: 0.875rem 1rem;
        margin: 0 1rem;
        display: flex !important;
    }

    .user-dropdown-actions {
        padding: 0.75rem 1rem 1rem;
        display: flex !important;
        flex-direction: column;
    }

    .dropdown-action-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        display: block !important;
    }
}

/* ===================================
   CUSTOM MODAL / POPUP
   =================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    text-align: center;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.modal-message {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.modal-btn-cancel {
    background: var(--light-bg);
    color: var(--text-dark);
}

.modal-btn-cancel:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.modal-btn-confirm {
    background: var(--gradient-1);
    color: var(--white);
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive modal */
@media screen and (max-width: 480px) {
    .modal-container {
        padding: 2rem 1.5rem;
    }

    .modal-icon {
        font-size: 3rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-message {
        font-size: 1rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}

/* ================================================
   ENHANCED SONG LEARNING SYSTEM - PHASE 1 STYLES
   ================================================ */

/* Enhanced Song Player */
.enhanced-song-player {
    max-width: 900px;
    margin: 0 auto;
}

.song-header-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toggle-tab-guide-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.toggle-tab-guide-btn:hover {
    background: #0056b3;
}

/* Skill Level Selector */
.skill-level-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.skill-level-selector label {
    font-weight: 600;
    color: #333;
    margin-right: 0.5rem;
}

.skill-level-btn {
    padding: 0.5rem 1.2rem;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #495057;
}

.skill-level-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.skill-level-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Tab Reading Guide */
.tab-reading-guide {
    background: #fff8dc;
    border: 2px solid #f0e68c;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tab-guide-content h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.tab-guide-section {
    margin-bottom: 1.5rem;
}

.tab-guide-section h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.tab-guide-section pre {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Song Sections */
.song-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.song-section {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.song-section:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.song-section.expanded {
    border-color: var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: #f8f9fa;
    transition: background-color 0.2s;
}

.section-header:hover {
    background: #e9ecef;
}

.song-section.expanded .section-header {
    background: var(--primary-color);
    color: white;
}

.section-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.section-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.section-type-badge {
    background: white;
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.song-section.expanded .section-type-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.section-bars {
    font-size: 0.9rem;
    color: #6c757d;
}

.song-section.expanded .section-bars {
    color: rgba(255, 255, 255, 0.9);
}

.section-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.section-content {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.section-meta {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.strumming-pattern {
    font-size: 0.95rem;
}

.section-notes {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.section-chords {
    margin-bottom: 1.5rem;
}

.chord-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chord-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
}

.chord-badge:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

/* Tablature Container */
.tablature-container {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.tablature-header {
    margin-bottom: 1rem;
    color: #333;
}

.tablature-notation {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    overflow-x: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    color: #212529;
    margin-bottom: 1rem;
}

.tablature-techniques {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.tablature-techniques ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.tablature-techniques li {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.tablature-fingering {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Responsive Design for Enhanced Player */
@media (max-width: 768px) {
    .skill-level-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .skill-level-selector label {
        margin-bottom: 0.5rem;
    }

    .skill-level-btn {
        width: 100%;
    }

    .section-info {
        font-size: 0.9rem;
    }

    .tablature-notation {
        font-size: 0.75rem;
    }

    .song-header-controls {
        flex-direction: column;
    }

    .toggle-tab-guide-btn {
        width: 100%;
    }
}

/* ===================================
   PRACTICE COACH STYLES
   =================================== */

/* Mode Toggle */
.practice-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-dark);
    padding: 0.5rem;
    border-radius: 12px;
}

.mode-btn {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: var(--gradient-1);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.mode-btn:hover:not(.active) {
    background: rgba(74, 144, 226, 0.1);
    color: var(--accent-color);
}

/* Practice Coach Container */
.practice-coach-container {
    animation: fadeIn 0.3s ease;
}

.coach-challenge-selector {
    margin-bottom: 1.5rem;
}

.coach-challenge-selector h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Quick Challenges */
.quick-challenges {
    margin-bottom: 1.5rem;
}

.quick-challenges p {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.challenge-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
}

.challenge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.challenge-btn.selected {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* Challenge Type Buttons */
.challenge-type-buttons {
    margin-top: 1.5rem;
}

.challenge-type-buttons p {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.type-btn {
    padding: 0.8rem 1.2rem;
    margin-right: 0.8rem;
    margin-bottom: 0.8rem;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.type-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Selected Challenge Display */
.selected-challenge-display {
    background: var(--bg-light);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease;
}

.selected-challenge-display h4 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

/* Start Practice Button */
.start-practice-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-practice-btn:disabled {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

.start-practice-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 87, 108, 0.5);
}

/* Practice Overlays */
.practice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.practice-overlay-content {
    background: var(--bg-dark);
    border-radius: 20px;
    padding: 3rem;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: slideUp 0.4s ease;
    color: #ffffff;
}

.practice-overlay-content h2 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.practice-overlay-content p,
.practice-overlay-content span,
.practice-overlay-content label {
    color: #ffffff;
}

.challenge-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Challenge Selector Modal */
.challenge-selector-content {
    background: var(--bg-dark);
    border-radius: 20px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s ease;
}

.selector-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.selector-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
}

.close-selector-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-selector-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.selector-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.selector-panel {
    animation: fadeIn 0.3s ease;
}

.selector-search {
    margin-bottom: 1.5rem;
}

.selector-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.selector-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.selector-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Chord Grid */
.chord-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.chord-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.chord-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(74, 144, 226, 0.3);
}

.chord-item.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: white;
}

.chord-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.chord-notes {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

.chord-item.selected .chord-notes {
    color: rgba(255, 255, 255, 0.9);
}

/* Scale List */
.scale-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scale-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scale-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.scale-item.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: white;
}

.scale-info {
    flex: 1;
}

.scale-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.scale-notes {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

.scale-item.selected .scale-notes {
    color: rgba(255, 255, 255, 0.9);
}

.scale-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.scale-difficulty.easy {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.scale-difficulty.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.scale-difficulty.hard {
    background: rgba(244, 67, 54, 0.2);
    color: #F44336;
}

/* Song List */
.song-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.song-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.song-item.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: white;
}

.song-item .song-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.song-item .song-artist {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.song-item.selected .song-artist {
    color: rgba(255, 255, 255, 0.9);
}

.song-section {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    background: rgba(74, 144, 226, 0.2);
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.song-item.selected .song-section {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Custom Challenge Creator */
.custom-creator {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.create-custom-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.create-custom-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.4);
}

/* Mobile Responsiveness for Selector */
@media (max-width: 768px) {
    .challenge-selector-content {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .selector-header {
        border-radius: 0;
    }

    .chord-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.75rem;
    }

    .selector-body {
        padding: 1rem;
    }
}

/* Count-in Beats */
.countin-beats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 3rem 0;
}

.countin-beat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.beat-number {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 4px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.countin-beat.active .beat-number {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    border-color: #4CAF50;
    color: white;
    transform: scale(1.3);
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.6);
}

.beat-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.countin-beat.active .beat-label {
    color: #4CAF50;
}

.countin-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Waveform */
.waveform-container {
    margin: 2rem 0;
}

.waveform-container p,
.waveform-container strong {
    margin-bottom: 1rem;
    color: #ffffff;
}

#waveform-canvas {
    width: 100%;
    max-width: 600px;
    height: 100px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

/* Beat Indicator Large */
.beat-indicator-large {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.beat-box {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.beat-box.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Detection Preview */
.detection-preview {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.detection-preview p,
.detection-preview strong {
    color: #ffffff;
    margin: 0;
}

#detected-notes {
    color: #4CAF50;
    font-weight: 600;
}

/* Recording Time */
.recording-time {
    font-size: 1.3rem;
    color: #ffffff;
    margin: 1.5rem 0;
    font-weight: 600;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
    margin: 2rem 0 1rem 0;
    border: 2px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-percent {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 2rem;
}

.analyzing-steps {
    text-align: left;
    margin-top: 2rem;
}

.analyzing-steps p {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Results Content */
.practice-results-content {
    max-width: 900px;
    text-align: left;
}

.close-results-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-results-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    transform: rotate(90deg);
}

.results-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.results-header.excellent {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
}

.results-header.good {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
}

.results-header.needs-work {
    background: linear-gradient(135deg, #FF9800 0%, #F44336 100%);
}

.results-header h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.accuracy-display {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin: 1rem 0;
}

.accuracy-bar {
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 1rem;
}

.accuracy-fill {
    height: 100%;
    background: white;
    transition: width 1s ease;
}

/* Results Details */
.results-details {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-details h4 {
    color: #ffffff;
    margin-bottom: 1rem;
}

.results-details p,
.results-details span {
    color: #ffffff;
}

.note-detection-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-left: 4px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.note-detection-item.correct {
    border-left-color: #4CAF50;
}

.note-detection-item.partial {
    border-left-color: #FFC107;
}

.note-detection-item.incorrect {
    border-left-color: #F44336;
}

/* Results Feedback */
.results-feedback {
    background: #fff3cd;
    border-left: 4px solid #FFC107;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-feedback h4 {
    color: #856404;
    margin-bottom: 1rem;
}

.results-feedback p {
    color: #856404;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

/* Playback */
.results-playback {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-playback h4 {
    color: #ffffff;
}

.results-playback span {
    color: #ffffff;
}

.playback-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.playback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.playback-progress {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.playback-bar {
    height: 100%;
    background: var(--gradient-1);
    width: 0%;
    transition: width 0.1s linear;
}

.playback-time {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.action-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.action-btn-primary {
    background: var(--gradient-1);
    color: white;
    border: 2px solid rgba(74, 144, 226, 0.5);
}

.action-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

/* Utility Buttons */
.cancel-btn, .stop-btn {
    padding: 0.8rem 2rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.cancel-btn:hover, .stop-btn:hover {
    background: #F44336;
    color: white;
    border-color: #F44336;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .practice-overlay-content {
        padding: 2rem 1.5rem;
        width: 95%;
    }

    .practice-overlay-content h2 {
        font-size: 1.5rem;
    }

    .countin-beats {
        gap: 1rem;
    }

    .beat-number {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .beat-box {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .accuracy-display {
        font-size: 2.5rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .action-btn {
        min-width: 100%;
    }

    .mode-btn {
        font-size: 0.85rem;
        padding: 0.7rem 0.8rem;
    }

    #waveform-canvas {
        width: 100%;
        height: 80px;
    }
}
