/* ==========================
   Variables / Global
========================== */

:root {
    --bg: #111;
    --panel: #1c1c1c;
    --card: #222;
    --light-card: #fff;

    --text: #fff;
    --dark-text: #111;
    --muted: #777;

    --accent: #157787;
    --accent-hover: #27b2c5;

    --border: rgba(255,255,255,.1);
    --shadow: 0 10px 30px rgba(0,0,0,.5);
}


* {
    box-sizing: border-box;
}
button {
    font-family: inherit;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}


/* ==========================
   Link Styles
========================== */

a {
    color: var(--accent);
    text-decoration: none;
    transition: .2s ease;
}


a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}


a:active {
    opacity: .7;
}


/* ==========================
   Header / Navigation
========================== */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: var(--panel);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}


.logo {
    display: flex;
    align-items: center;
}


.logo img {
    height: 60px;
    width: auto;
    display: block;
}


nav {
    display: flex;
    gap: 20px;
}


nav a {
    color: var(--text);
    font-weight: 600;
}


nav a:hover {
    color: var(--accent);
    text-decoration: none;
}
.reward-link {
    font-weight: bold;
    white-space: nowrap;
}

.reward-link:hover {
    color: var(--accent);
}

/* ==========================
   Hamburger
========================== */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;

    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    z-index: 200;
}


/* ==========================
   Hero
========================== */

.hero {
    text-align: center;
    padding: 100px 20px;
}


.hero h2 {
    font-size: 48px;
}


/* ==========================
   Buttons
========================== */

.button,
.back-button,
.lesson-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--accent);
    color: var(--text);

    border: none;
    outline: none;

    text-decoration: none;
    border-radius: 8px;

    font-weight: bold;
    cursor: pointer;

    transition: .2s ease;

    appearance: none;
    -webkit-appearance: none;
}


.button {
    margin-top: 20px;
    padding: 15px 30px;
}


.back-button {
    padding: 12px 25px;
}


.button:hover,
.back-button:hover,
.lesson-actions button:hover {
    background: var(--accent-hover);
    color: var(--text);
    transform: translateY(-2px);
    text-decoration: none;
}


.button:focus,
.back-button:focus,
.lesson-actions button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(21,119,135,.35);
}

/* ==========================
   Feature Cards
========================== */

.features {
    display:grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap:20px;
}
@media(max-width:900px){

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

}

.back-full,
.back-short,
.back-shorter {
    display: none;
}

@media (min-width: 651px) {
    .back-full {
        display: inline !important;
    }
}

@media (max-width: 650px) {

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

    .back-short {
        display: inline;
    }
}

@media (max-width: 440px) {
    .back-short {
        display: none;
    }

    .back-shorter {
        display: inline;
    }
}

.card {
    background: var(--card);
    padding: 25px;
    border-radius: 10px;
}


/* ==========================
   Lesson Cards
========================== */

.lesson {
    display: flex;
    gap: 12px;
    min-height: 90px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--light-card);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}


.lesson-image {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.lesson-image img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}


.lesson-content {
    flex: 1;
	min-width: 0;
}


.lesson h4 {
    margin: 0 0 5px;
    color: var(--dark-text);
    font-size: 16px;
}


.lesson-description {
    margin: 0 0 5px;
    color: var(--muted);
    line-height: 1.3;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.lesson .button {
    padding: 6px 12px;
    margin-top: 5px;
    font-size: 13px;
    border-radius: 5px;
}


.lesson-button {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    background: var(--accent);
    color: var(--text);
    font-weight: 600;
    transition: .2s ease;
}


.lesson-button:hover {
    background: var(--accent-hover);
    color: var(--text);
    transform: translateY(-2px);
    text-decoration: none;
}
/* ==========================
   Lesson Tags
========================== */

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}


.lesson-tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}


.lesson-tag.difficulty.beginner {
    background: #8d6e63;
	color: var(--text);
}


.lesson-tag.difficulty.intermediate {
    background: #3498db;
	color: var(--text);
}


.lesson-tag.difficulty.advanced {
    background: #8e44ad;
	color: var(--text);
}


.lesson-tag.type {
    background: #10b981;
	color: var(--text);
}


.lesson-tag.style {
    background: #B8860B;
    color: var(--text);
}
/* ==========================
   Tablet Lesson Fix
========================== */

@media (max-width: 1024px) {

    .lesson {
        flex-direction: column;
        padding: 12px;
    }

    .lesson-image {
        width: 100%;
        gap: 10px;
    }

    .lesson-image img {
        width: 100%;
        height: 140px;
    }

    .lesson-content {
        min-width: 0;
    }

    .lesson h4 {
        font-size: 18px;
        line-height: 1.3;
        overflow-wrap: break-word;
    }

    .lesson-description {
        -webkit-line-clamp: 3;
    }

    .lesson-meta {
        gap: 6px;
    }

    .lesson-button {
        width: 100%;
    }
}

/* ==========================
   Lesson Filters
========================== */

.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    margin: 20px 0;
    padding: 15px 20px;

    background: var(--panel);
    border-radius: 10px;
    border-left: 5px solid var(--accent);

    font-size: .95rem;
}


.active-filters strong {
    color: var(--text);
    margin-right: 5px;
}


.active-filters span {
    display: inline-block;
    padding: 6px 14px;

    background: #34495e;
    color: white;

    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}


.active-filters a {
    margin-left: auto;

    padding: 7px 16px;

    background: #d63031;
    color: white;

    border-radius: 20px;

    font-size: .85rem;
    font-weight: bold;

    transition: .2s ease;
}


.active-filters a:hover {
    opacity: .8;
    color: white;
    text-decoration: none;
}


.see-more {
    display: block;

    margin-top: 20px;
    padding-top: 15px;

    text-align: center;

    border-top: 1px solid var(--border);

    color: var(--text);
    font-weight: 600;

    transition: .2s ease;
}


.see-more:hover {
    color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}


/* ==========================
   Individual Lesson Page
========================== */

.lesson-page {
    max-width: 1000px;
    margin: 50px auto;

    padding: 30px;

    background: var(--panel);
    border-radius: 15px;

    box-shadow: var(--shadow);
}


.lesson-header {
    text-align: center;
    margin-bottom: 30px;
}


.lesson-header h1 {
    margin: 0 0 20px;

    font-size: 42px;
    color: var(--accent);
}


.lesson-header p {
    max-width: 850px;

    margin: auto;

    color: #ddd;

    font-size: 18px;
    line-height: 1.6;
}


/* ==========================
   Video Player
========================== */

.video-container {
    position: relative;

    width: 100%;
    padding-top: 56.25%;

    overflow: hidden;

    background: #000;

    border-radius: 12px;

    box-shadow: 0 5px 20px rgba(0,0,0,.6);
}


.video-container iframe,
.video-container video {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    border: 0;
}


.video-container video {
    object-fit: contain;
}

.lesson-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}


.lesson-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-actions form {
    display: flex;
    margin: 0;
    padding: 0;
}

.favorite-button {
	margin-top:0px;
    height: 42px;
    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    white-space: nowrap;

    border: none;
    outline: none;

    font-size: .95rem;
    border-radius: 8px;

    background: var(--accent);
    color: var(--text);

    cursor: pointer;
}
.favorite-short {
    display: none;
}


.favorite-short {
    display: none;
}

@media (max-width: 600px) {

    .favorite-full {
        display: none;
    }

    .favorite-short {
        display: inline;
        font-size: 1.4rem;
    }

    .favorite-button {
        width: 42px;
        padding: 0;
    }
}
.lesson-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lesson-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text);
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
/* Lesson Rating Stars */

.rating-form {
    margin-top: 10px;
}

.stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.stars input {
    display: none;
}

.stars label {
    font-size: 32px;
    color: #aaa;
    cursor: pointer;
    transition: color .2s;
}


/* Hover effect */
.stars label:hover,
.stars label:hover ~ label {
    color: gold;
}


/* Selected stars */
.stars input:checked ~ label {
    color: gold;
}
.comments-section {
    margin-top: 30px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment {
    background: var(--card);
    padding: 15px;
    border-radius: 10px;
    margin-top: 12px;
}

.comment small {
    color: var(--muted);
    margin-left: 10px;
}

.modal {
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.7);
    align-items:center;
    justify-content:center;
    z-index:1000;
}


.modal-content {
    background:var(--panel);
    width:90%;
    max-width:500px;
    padding:25px;
    border-radius:12px;
}


.modal textarea {
    width:100%;
    min-height:120px;
    padding:10px;
    margin-bottom:15px;
}


.close {
    float:right;
    font-size:25px;
    cursor:pointer;
}
/* ==========================
   Metronome
========================== */

.metronome-page {

    min-height: calc(100vh - 90px);

    display: flex;

    justify-content: center;
    align-items: center;

    padding: 30px 20px;
}


.metronome {

    width: min(95vw,850px);

    margin: 50px auto;

    padding: 35px;

    text-align: center;

    background: linear-gradient(145deg,#333,#1b1b1b);

    border-radius: 30px;

    box-shadow: 0 20px 60px rgba(0,0,0,.7);
}


.metronome h1 {

    margin: 0 0 25px;

    font-size: clamp(28px,5vw,44px);
}


.tempo {

    font-size: clamp(60px,12vw,100px);

    font-weight: 900;

    letter-spacing: 3px;
}


/* ==========================
   Metronome Controls
========================== */

input[type="range"] {

    width: 100%;

    height: 12px;

    cursor: pointer;
}


.labels {

    display: flex;

    justify-content: space-between;

    opacity: .7;
}


.section-title {

    margin-top: 25px;

    font-size: 20px;
}


.settings {

    display: grid;

    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));

    gap: 20px;

    margin-top: 25px;
}


.setting {

    padding: 20px;

    background: #252525;

    border-radius: 18px;
}


.setting label {

    font-size: 18px;
}


select {

    width: 100%;

    padding: 15px;

    font-size: 18px;

    border: none;

    border-radius: 12px;
}


.checkbox {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 15px;
}


.checkbox input {

    width: 25px;

    height: 25px;
}


.beat-counter {

    margin: 25px;

    font-size: 32px;

    font-weight: bold;
}
/* ==========================
   Pendulum
========================== */

.pendulum-container {
    height: 190px;
}


.pendulum-arm {
    position: relative;

    width: 8px;
    height: 160px;

    margin: auto;

    background: #ddd;

    border-radius: 10px;

    transform-origin: top center;

    transition: transform .08s linear;
}


.pendulum-arm::before {

    content: "";

    position: absolute;

    bottom: -15px;

    left: 50%;

    width: 40px;
    height: 40px;

    background: #ff5252;

    border-radius: 50%;

    transform: translateX(-50%);
}


/* ==========================
   Beat Indicator
========================== */

.beat-indicator {

    width: 90px;
    height: 90px;

    margin: 25px auto;

    background: #555;

    border-radius: 50%;

    transition: .08s;
}


.beat-indicator.active {

    background: #4caf50;

    transform: scale(1.25);
}


/* ==========================
   Metronome Buttons
========================== */

.metronome button {

    width: 100%;

    min-height: 65px;

    margin-top: 15px;

    border: none;

    border-radius: 18px;

    color: white;

    font-size: 24px;

    font-weight: bold;

    cursor: pointer;

    transition: .2s ease;
}


.metronome button:hover {

    transform: translateY(-2px);

    opacity: .9;
}


#toggleBtn {

    background: #4caf50;
}


#tapBtn {

    background: #2196f3;
}


.rhythm-buttons {

    display: grid;

    grid-template-columns: repeat(auto-fit,minmax(120px,1fr));

    gap: 12px;

    margin-top: 15px;
}


.rhythm-buttons button {

    min-height: 50px;

    font-size: 18px;

    background: #444;
}


.rhythm-buttons button.active {

    background: var(--accent);

    color: var(--dark-text);
}


.tap-display {

    margin-top: 15px;

    font-size: 20px;
}


/* ==========================
   Responsive
========================== */

@media (max-width:768px) {


    .menu-toggle {

        display: block;

    }


    nav {

        display: none;

        flex-direction: column;

        gap: 0;

        position: absolute;

        top: 100%;

        right: 20px;

        min-width: 200px;

        background: var(--panel);

        border-radius: 10px;

        overflow: hidden;

        box-shadow: var(--shadow);

        z-index: 100;
    }


    nav.open {

        display: flex;

    }


    nav a {

        padding: 15px;

        border-bottom: 1px solid var(--border);

    }


    nav a:last-child {

        border-bottom: none;

    }


    .lesson-page {

        margin: 20px;

        padding: 20px;

    }


    .lesson-header h1 {

        font-size: 30px;

    }


    .lesson-header p {

        font-size: 16px;

    }

}



@media (min-width:900px) {


    .metronome {

        padding: 45px;

    }


    .metronome button {

        width: 48%;

        display: inline-block;

    }

}



@media (max-width:500px) {


    .metronome {

        padding: 20px;

        border-radius: 20px;

    }


    .tempo {

        font-size: 55px;

    }


    .logo img {

        height: 50px;

    }

}


/* ==========================
   Authentication
========================== */

.auth-container {

    min-height: calc(100vh - 100px);

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 30px;
}



.auth-card {

    background: var(--panel);

    color: var(--text);

    width: 100%;

    max-width: 420px;

    padding: 35px;

    border-radius: 12px;

    box-shadow: var(--shadow);
}



.auth-card h1 {

    text-align: center;

}



.auth-card label {

    display: block;

    margin-top: 15px;

}



.auth-card input {

    width: 100%;

    padding: 12px;

    margin-top: 5px;

    border-radius: 6px;

    border: none;

    background: white;

    color: var(--dark-text);
}



.auth-card button {
    appearance:none;
    -webkit-appearance:none;
    width: 100%;

    margin-top: 25px;

    padding: 12px;

    background: var(--accent);

    color: var(--text);

    border: none;

    border-radius: 6px;

    font-weight: bold;

    cursor: pointer;

    transition: .2s ease;
}



.auth-card button:hover {

    background: var(--accent-hover);

}



.alert {

    background: #8b0000;

    padding: 10px;

    border-radius: 6px;

    margin: 15px 0;

}



.auth-link {

    text-align: center;

    margin-top: 20px;

}

/* ==========================
   Tablet Lesson Card Fix
========================== */

@media (max-width: 900px) {

    .lesson-card {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 0;
    }


    .lesson-card img,
    .lesson-thumbnail {
        width: 100%;
        height: 140px;
        object-fit: cover;
        border-radius: 12px 12px 0 0;
    }


    .lesson-card-content {
        width: 100%;
        padding: 12px;
    }


    .lesson-card h3 {
        font-size: 1.1rem;
        line-height: 1.2;
        margin-bottom: 10px;

        /* prevent overflow */
        overflow-wrap: break-word;
        word-break: normal;
    }


    .lesson-card p {
        font-size: .95rem;
        line-height: 1.4;

        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }


    .lesson-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }


    .lesson-card button,
    .lesson-card .view-button {
        width: 100%;
        margin-top: 10px;
    }
}

/* ==========================
   PROFILE PAGE
========================== */
.profile-container {

    display: flex;
    justify-content: center;
    padding: 40px 20px;

}


.profile-card {

	width: 100%;
    max-width: 1100px;
    padding: 25px;
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);

	


}


.profile-card h1 {

    text-align: center;
    margin-bottom: 10px;

}


.profile-welcome {

    text-align: center;
    color: #aaa;
    margin-bottom: 30px;

}


.profile-section {

    margin-top: 25px;

}


.profile-row {

    display: flex;
    justify-content: space-between;
    gap: 20px;

    padding: 12px 0;

    border-bottom: 1px solid #333;

}


.profile-row span {

    color: #aaa;

}


.reward-box {

    text-align: center;

    margin-top: 30px;

    padding: 25px;

    border-radius: 10px;

    background: #222;

}


.reward-number {

    font-size: 48px;

    font-weight: bold;

    margin: 15px 0;

}
.collapsible-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}


.collapsible-content {
    overflow: hidden;
    transition: max-height .3s ease;
}


#favorite-lessons.collapsed {
    display: none;
}


#favorite-arrow {
    font-size: 0.8em;
}

.future-box {

    opacity: .8;

}


.logout-button {

    display: block;

    text-align: center;

    margin-top: 30px;

    padding: 12px;

    background: var(--accent);

    color: var(--text);

    border-radius: 8px;

    text-decoration: none;

    font-weight: bold;

}
.logout-button:hover {

    background: var(--accent-hover);
    color: var(--text);
	text-decoration: none;


}
.lesson-progress-card {
    background: var(--panel);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.lesson-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.lesson-complete {
    margin-top: 10px;
    color: #4caf50;
}
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}


/* Keep everything as normal boxes */
.favorites-section {
    grid-column: auto;
}


@media (max-width: 900px) {

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

}
/* ==========================
   Merch Page
========================== */

.merch-page {

    max-width: 1200px;

    margin: 40px auto;

    padding: 30px;

}


.merch-header {

    text-align: center;

    background: var(--panel);

    padding: 35px;

    border-radius: 15px;

    box-shadow: var(--shadow);

    margin-bottom: 35px;

}


.merch-header h1 {

    margin: 0 0 15px;

    font-size: clamp(30px,5vw,48px);

    color: var(--accent);

}


.merch-header p {

    color: #ddd;

    font-size: 18px;

}


/* Product Grid */

.merch-grid {

    display: grid;

    grid-template-columns: repeat(4, minmax(0,1fr));

    gap: 20px;

}



.merch-card {

    background: var(--panel);

    border-radius: 12px;

    overflow: hidden;

    box-shadow: var(--shadow);

    transition: .2s ease;

}



.merch-card:hover {

    transform: translateY(-5px);

}



.merch-card img {

    width:100%;

    height:250px;

    object-fit:cover;

    display:block;

}



.merch-content {

    padding:20px;

    text-align:center;

}



.merch-content h3 {

    margin-top:0;

}



.merch-price {

    color: var(--accent);

    font-weight:bold;

    font-size:20px;

    margin:15px 0;

}



.merch-button {

    display:block;

    padding:12px;

    background:var(--accent);

    color:var(--text);

    border-radius:8px;

    font-weight:bold;

    text-decoration:none;

}



.merch-button:hover {

    background:var(--accent-hover);

    color:var(--text);

    text-decoration:none;

}



/* Tablet */

@media(max-width:900px){

    .merch-grid {

        grid-template-columns:repeat(2,minmax(0,1fr));

    }

}



/* Mobile */

@media(max-width:600px){

    .merch-page {

        padding:20px;

    }


    .merch-grid {

        grid-template-columns:1fr;

    }


    .merch-card img {

        height:220px;

    }

}

/* Teacher Dashboard */
.teacher-dashboard {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.teacher-dashboard h1 {
    margin-bottom: 25px;
}

.teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.teacher-card {
    display: block;
    background: var(--card);
    padding: 25px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: 0.2s ease;
}

.teacher-card:hover {
    transform: translateY(-4px);
}

.teacher-card h2 {
    margin-bottom: 10px;
}

.teacher-card p {
    color: var(--muted);
}
.teacher-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.teacher-button {
    display: block;
    text-align: center;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    background: #333;
    color: var(--text);
    transition: 0.2s;
}

.teacher-button:hover {
    transform: translateY(-2px);
}

.teacher-button-primary {
    background: var(--accent);
    color: white;
}