/* Mexican Storefront Color Palette */
:root {
    --sky-blue: #87CEEB;
    --light-blue: #B0E0E6;
    --painted-blue: #9DD5ED;
    --mango: #FFB347;
    --mango-dark: #FF9500;
    --terracotta: #E07856;
    --cream: #FFF8E7;
    --dusty-pink: #D4A5A5;
    --sage-green: #9CAF88;
    --burgundy: #800020;
    --warm-white: #FAF8F3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    background: var(--painted-blue);
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background-color: transparent;
    padding: 1.5rem 2rem;
    text-align: center;
}

.site-logo {
    max-width: 500px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tagline {
    font-family: 'Rubik', sans-serif;
    font-size: 1.2rem;
    color: #333;
    margin-top: 1rem;
    font-weight: 400;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Playlist Sections */
.playlist-section {
    margin-bottom: 4rem;
    background-color: var(--warm-white);
    padding: 2rem;
    border-radius: 12px;
    border: 5px solid var(--cream);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.playlist-title {
    font-family: 'Caveat Brush', cursive;
    font-size: 3rem;
    color: var(--mango);
    text-align: center;
    margin-bottom: 2rem;
    transform: rotate(-1deg);
    text-shadow: 2px 2px 0 var(--terracotta);
}

.playlist-title a {
    color: var(--mango);
    text-decoration: none;
    transition: color 0.2s;
}

.playlist-title a:hover {
    color: var(--mango-dark);
    text-decoration: underline;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    align-items: start;
}

.video-card {
    background-color: white;
    border: 4px solid var(--sage-green);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 4px 4px 0 var(--sage-green);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.video-card:hover {
    transform: translateY(-4px) rotate(1deg);
    box-shadow: 6px 6px 0 var(--sage-green);
}

.video-card.hidden {
    display: none;
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-bottom: 3px solid var(--sage-green);
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--burgundy);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    text-decoration: none;
}

.video-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Load More Button */
.load-more-btn {
    grid-column: 1 / -1;
    margin: 1rem auto 0;
    padding: 1rem 2.5rem;
    background-color: var(--mango);
    color: white;
    border: 4px solid var(--mango-dark);
    border-radius: 8px;
    font-family: 'Chewy', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--mango-dark);
    transition: transform 0.2s, box-shadow 0.2s;
    transform: rotate(-1deg);
    display: block;
}

.load-more-btn:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 6px 6px 0 var(--mango-dark);
}

.error {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--burgundy);
    background-color: var(--dusty-pink);
    border-radius: 8px;
    border: 3px solid var(--terracotta);
    margin-bottom: 2rem;
}

/* Footer */
footer {
    background-color: var(--sage-green);
    color: var(--cream);
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 5px solid var(--terracotta);
}

.markdown-link {
    color: var(--cream);
    font-family: 'Chewy', cursive;
    font-size: 1rem;
    text-decoration: none;
    opacity: 0.8;
}

.markdown-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .site-logo {
        max-width: 400px;
    }

    .playlist-title {
        font-size: 2rem;
    }

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

    main {
        padding: 1rem;
    }
}

/* ── Auth Page ──────────────────────────────────────────────────── */

.auth-body {
    background: #0f0f0f;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rubik', sans-serif;
}

.auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(224, 120, 86, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 179, 71, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(156, 175, 136, 0.1) 0%, transparent 50%),
        #0f0f0f;
}

.auth-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
    width: 100%;
    max-width: 360px;
    backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 32px 64px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3);
    animation: auth-card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.auth-icon {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(255, 179, 71, 0.4));
    animation: auth-icon-bounce 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@keyframes auth-icon-bounce {
    from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
    to   { opacity: 1; transform: scale(1)   rotate(0deg); }
}

.auth-title {
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}

.auth-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.auth-status {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1.25rem;
    min-height: 1.2em;
    transition: color 0.2s;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--mango) 0%, var(--mango-dark) 100%);
    color: #1a0a00;
    border: none;
    border-radius: 14px;
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 20px rgba(255, 149, 0, 0.4), 0 1px 3px rgba(0,0,0,0.3);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(255, 149, 0, 0.5), 0 2px 6px rgba(0,0,0,0.3);
}

.auth-btn:active {
    transform: translateY(0) scale(0.98);
    opacity: 0.9;
}

.auth-btn__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Workout Logger ─────────────────────────────────────────────── */

.workout-logger {
    min-height: 100vh;
    background: var(--warm-white);
    color: #333;
    font-family: 'Rubik', sans-serif;
    padding-bottom: 3rem;
}

/* Header */
.logger-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--warm-white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 0.5rem;
    gap: 0.75rem;
    text-align: left;
}

.logger-header__info {
    flex: 1 1 auto;
    min-width: 0;
}

.logger-header__name {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logger-header__date {
    font-size: 0.85rem;
    opacity: 0.5;
    margin-top: 0.1rem;
}

.logger-header__right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.5rem;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logger-header__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.05rem;
}

.logger-timer {
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--mango);
    line-height: 1;
}

.logger-progress {
    font-size: 0.82rem;
    opacity: 0.5;
}

.btn--finish,
.btn--finish input[type="submit"] {
    background: var(--sage-green);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.55rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn--finish input[type="submit"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn--cancel,
.btn--cancel input[type="submit"] {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--muted);
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.btn--cancel input[type="submit"]:hover,
.btn--cancel:hover {
    color: var(--danger, #c0392b);
    border-color: var(--danger, #c0392b);
}

.btn--resync,
.btn--resync input[type="submit"] {
    background: transparent;
    color: var(--mango-dark);
    border: 1px solid var(--mango-dark);
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.btn--resync input[type="submit"]:hover,
.btn--resync:hover {
    background: var(--mango-dark);
    color: white;
}

.logger-header__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 480px) {
    .logger-header__actions .btn,
    .logger-header__actions input[type="submit"] {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .logger-header__right,
    .logger-header__actions {
        flex-basis: 100%;
    }

    .logger-header__right {
        justify-content: space-between;
    }
}

.logger-body {
    padding: 0 1rem;
}

/* Warm-up block */
.warmup-block {
    margin: 0.75rem 0;
    background: rgba(156, 175, 136, 0.1);
    border: 1px solid rgba(156, 175, 136, 0.2);
    border-radius: 0.8rem;
    overflow: hidden;
}

.warmup-block__header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    gap: 0.5rem;
    user-select: none;
}

.warmup-block__title {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sage-green);
}

.warmup-block__toggle {
    font-size: 0.75rem;
    opacity: 0.45;
}

.warmup-block__body {
    padding: 0 1rem 0.75rem;
}

.warmup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 1rem;
}

.warmup-row__name {
    flex: 1;
    opacity: 0.8;
}

.warmup-row__target {
    opacity: 0.45;
    font-size: 0.92rem;
    margin-left: 0.5rem;
}

/* Exercise card */
.exercise-card {
    margin: 0.75rem 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.8rem;
    overflow: hidden;
}

.exercise-card__header {
    padding: 0.8rem 1rem 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.exercise-card__name {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 700;
}

.exercise-card__toggle {
    font-size: 0.75rem;
    opacity: 0.45;
}

.exercise-card__note {
    margin: 0.4rem 1rem 0.25rem;
    font-size: 0.92rem;
    opacity: 0.55;
    line-height: 1.5;
    font-style: italic;
}

.exercise-card__sets {
    padding: 0.35rem 0.75rem 0.75rem;
}

/* Superset card */
.superset-card {
    margin: 0.75rem 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-left: 3px solid var(--terracotta);
    border-radius: 0.8rem;
    overflow: hidden;
}

.superset-card__header {
    padding: 0.8rem 1rem 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.superset-card__header-text {
    flex: 1;
}

.superset-card__toggle {
    font-size: 0.75rem;
    opacity: 0.45;
}

.superset-card__label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--terracotta);
}

.superset-card__names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.6rem;
    margin-top: 0.25rem;
}

.superset-card__exercise-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.superset-card__note {
    margin: 0.25rem 1rem 0;
    font-size: 0.9rem;
    opacity: 0.5;
    line-height: 1.5;
    font-style: italic;
}

.superset-card__rounds {
    padding: 0.25rem 0.75rem 0.75rem;
}

.superset-round {
    margin-top: 0.75rem;
}

.superset-round__label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.35;
    margin-bottom: 0.2rem;
}

.superset-round__set {
    margin-top: 0.35rem;
}

.superset-round__exercise-name {
    font-size: 0.85rem;
    opacity: 0.45;
    margin-bottom: 0.15rem;
    padding-left: 0.25rem;
}

/* Set row */
.set-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.5rem;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: opacity 0.15s ease;
}

.set-row--done .set-row__order,
.set-row--done .set-row__content {
    opacity: 0.4;
}

.set-row--done .set-row__note-btn:not(.set-row__note-btn--active) {
    opacity: 0.4;
}

.set-row--done .set-row__check {
    background: var(--sage-green);
    color: white;
    border-color: var(--sage-green);
}

.set-row--done .set-row__rpe {
    display: flex;
}

.set-row:last-child {
    border-bottom: none;
}

.set-row__order {
    font-size: 0.88rem;
    font-weight: 700;
    opacity: 0.3;
    min-width: 1.4rem;
    padding-top: 0.1rem;
}

.set-row__content {
    flex: 1;
    min-width: 0;
}

.set-row__target {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.set-row__target-weight {
    color: #222;
}

.set-row__target-weight::after {
    content: " lb";
    font-size: 0.88rem;
    font-weight: 400;
    opacity: 0.45;
}

.set-row__sep {
    opacity: 0.4;
    font-weight: 400;
}

.set-row__target-reps {
    color: #444;
}

.set-row__target-time {
    color: var(--mango);
}

.set-row__previous {
    font-size: 0.85rem;
    opacity: 0.35;
    font-style: italic;
    margin-top: 0.1rem;
}

.set-row__inputs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Steppers */
.stepper {
    display: flex;
    align-items: center;
}

.stepper__btn {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.28);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    color: #222;
    touch-action: manipulation;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper__btn:active {
    background: rgba(0, 0, 0, 0.08);
    box-shadow: none;
}

.stepper__input {
    width: 2.4rem;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    -moz-appearance: textfield;
    padding: 0.1rem 0;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper__input:focus {
    outline: 2px solid var(--sage-green);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Check button */
.set-row__check {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid var(--sage-green);
    background: transparent;
    color: var(--sage-green);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    margin-left: auto;
}

.set-row__check:active {
    background: rgba(156, 175, 136, 0.15);
}

/* RPE chip row — hidden until the set is done */
.set-row__rpe {
    display: none;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    padding-left: 2rem;
    padding-bottom: 0.3rem;
}

.rpe-chip {
    padding: 0.3rem 0.65rem;
    border-radius: 1rem;
    border: 1.5px solid rgba(0, 0, 0, 0.25);
    background: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    touch-action: manipulation;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.rpe-chip:active {
    background: rgba(0, 0, 0, 0.08);
    box-shadow: none;
}

.rpe-chip--selected {
    background: var(--terracotta);
    border-color: var(--terracotta);
    color: white;
}

/* Set note */
.set-row__note-btn {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: transparent;
    font-size: 0.9rem;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.set-row__note-btn:active {
    background: rgba(0, 0, 0, 0.08);
}

.set-row__note-btn--active {
    color: var(--sage-green);
    border-color: var(--sage-green);
}

.set-row__note-area {
    display: none;
    width: 100%;
    padding-left: 2rem;
    padding-bottom: 0.3rem;
}

.set-row__note-area--open {
    display: block;
}

.set-row__note-input {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 0.4rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #444;
    background: rgba(0, 0, 0, 0.02);
    resize: none;
    line-height: 1.4;
}

.set-row__note-input:focus {
    outline: 2px solid var(--sage-green);
    outline-offset: 1px;
    border-color: transparent;
}

/* Warmup row check button + done state */
.warmup-row__check {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1.5px solid rgba(156, 175, 136, 0.4);
    background: transparent;
    color: rgba(0, 0, 0, 0.25);
    font-size: 0.88rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    margin-left: 0.5rem;
}

.warmup-row--done .warmup-row__check {
    background: var(--sage-green);
    color: white;
    border-color: var(--sage-green);
}

.warmup-row--done .warmup-row__name,
.warmup-row--done .warmup-row__target {
    opacity: 0.3;
    text-decoration: line-through;
}

/* Workout today page (start prompt) */
.workout-page {
    min-height: 100vh;
    background: var(--warm-white);
    color: #333;
    font-family: 'Rubik', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
}

.workout-page h1 {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.workout-meta {
    font-size: 1rem;
    opacity: 0.55;
    margin-bottom: 0.75rem;
}

.workout-note {
    font-size: 1rem;
    opacity: 0.6;
    max-width: 36rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.workout-no-plan {
    opacity: 0.5;
    font-size: 1rem;
}

.workout-done-check {
    font-size: 3rem;
    color: #4caf50;
    margin-bottom: 0.5rem;
}

.workout-start-btn,
.workout-start-btn input[type="submit"] {
    background: var(--mango);
    color: #111;
    border: none;
    border-radius: 0.6rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin-top: 1rem;
}

.workout-start-btn:hover input[type="submit"],
.workout-start-btn input[type="submit"]:hover {
    background: var(--mango-dark);
}
