/* Exercise Detail Page */
.exercise-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.75rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2.75rem;
}

.exercise-detail-loading,
.exercise-detail-error {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    box-shadow: 0 28px 45px rgba(15, 23, 42, 0.08);
}

.exercise-detail-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1.5rem;
}

.exercise-detail-error .bi {
    font-size: 3rem;
    color: #f59f00;
    display: block;
    margin-bottom: 1rem;
}

.btn-back,
.btn-back-link {
    border: none;
    background: transparent;
    color: var(--accent-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-back:hover,
.btn-back-link:hover {
    background: rgba(124, 105, 255, 0.14);
    transform: translateX(-2px);
}

/* Hero */
.exercise-detail-hero {
    position: relative;
    border-radius: 26px;
    padding: clamp(2.2rem, 2vw + 1.75rem, 3rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.9rem, 2vw, 2.8rem);
    border: 1px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(124, 105, 255, 0.7), rgba(13, 110, 253, 0.58)) border-box;
    box-shadow: 0 22px 50px rgba(58, 52, 150, 0.22);
    overflow: hidden;
}

[data-theme="dark"] .exercise-detail-hero {
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(82, 67, 210, 0.78), rgba(31, 199, 212, 0.58)) border-box;
}

.exercise-detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(124, 105, 255, 0.18), transparent 55%),
        radial-gradient(120% 120% at 100% 100%, rgba(13, 110, 253, 0.16), transparent 55%);
    opacity: 0.45;
    pointer-events: none;
}

.hero-overview {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-header {
    display: flex;
    justify-content: center;
    width: 100%;
}

.hero-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: center;
    max-width: 40rem;
}

.hero-title-block h1 {
    font-size: clamp(2.4rem, 2.4vw + 2rem, 3.2rem);
    font-weight: 800;
    margin: 0;
    line-height: 1.08;
    color: var(--accent-contrast, #0b1026);
}

.hero-title-block p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.7;
}

[data-theme="dark"] .hero-title-block p {
    color: rgba(226, 232, 240, 0.82);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}

.hero-tag {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.26);
    backdrop-filter: blur(12px);
    color: var(--accent-contrast, #0b1026);
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .hero-tag {
    background: rgba(17, 24, 39, 0.65);
    border-color: rgba(124, 105, 255, 0.35);
    color: var(--text-primary);
}

.hero-tag .bi {
    font-size: 1rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
}

.btn-add-to-workout-detail {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 16px;
    border: none;
    padding: 0.85rem 1.7rem;
    font-weight: 700;
    background: var(--accent-gradient);
    color: var(--accent-contrast);
    box-shadow: 0 4px 16px rgba(124, 105, 255, 0.3);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.btn-add-to-workout-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 105, 255, 0.4);
}

.hero-media {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hero-media::before {
    content: "";
    position: absolute;
    inset: 12% 12% -18% 12%;
    background: radial-gradient(55% 55% at 50% 30%, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(50% 50% at 50% 70%, rgba(31, 199, 212, 0.08), transparent 60%);
    filter: blur(8px);
    opacity: 0.2;
}

.hero-media img {
    width: min(100%, 660px);
    border-radius: 26px;
    object-fit: cover;
    box-shadow: 0 22px 44px rgba(13, 110, 253, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Content Layout */
.exercise-detail-content {
    display: flex;
    flex-direction: column;
    gap: 2.85rem;
}

.detail-section {
    background: var(--card-bg);
    border-radius: 22px;
    padding: clamp(1.75rem, 1.5vw + 1.5rem, 2.4rem);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.9rem;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 1.3rem;
}

.section-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.section-header h2 {
    font-size: clamp(1.65rem, 0.7vw + 1.3rem, 1.95rem);
    font-weight: 700;
    margin: 0;
}

.section-header p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 48ch;
}

.section-icon-wrapper {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: var(--accent-primary);
    background: rgba(124, 105, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(124, 105, 255, 0.35);
}

[data-theme="dark"] .section-icon-wrapper {
    background: rgba(124, 105, 255, 0.28);
    box-shadow: inset 0 0 0 1px rgba(124, 105, 255, 0.42);
}

/* Instructions */
.instructions-section {
    position: relative;
    border: 1px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(13, 110, 253, 0.65), rgba(124, 105, 255, 0.52)) border-box;
    box-shadow: 0 22px 48px rgba(13, 110, 253, 0.22);
}

[data-theme="dark"] .instructions-section {
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(90, 167, 255, 0.6), rgba(124, 105, 255, 0.55)) border-box;
}

.instructions-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(140% 140% at 0% 0%, rgba(13, 110, 253, 0.22), transparent 60%),
        radial-gradient(140% 140% at 100% 100%, rgba(124, 105, 255, 0.18), transparent 60%);
    pointer-events: none;
    opacity: 0.6;
}

.section-icon-wrapper.instructions-icon {
    background: rgba(13, 110, 253, 0.18);
    color: var(--accent-primary);
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.32);
}

[data-theme="dark"] .section-icon-wrapper.instructions-icon {
    background: rgba(90, 167, 255, 0.24);
    box-shadow: inset 0 0 0 1px rgba(90, 167, 255, 0.4);
}

.instruction-single {
    position: relative;
    padding: 1.2rem 1.4rem;
    border-radius: 18px;
    border: 1px solid rgba(13, 110, 253, 0.28);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    line-height: 1.65;
    backdrop-filter: blur(6px);
}

/* Instruction Steps */
.instruction-steps {
    counter-reset: instruction;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
    margin: 0;
    padding: 0;
}

.instruction-steps li {
    counter-increment: instruction;
    position: relative;
    padding: 1.05rem 1.35rem 1.05rem 3.6rem;
    border-radius: 18px;
    border: 1px solid rgba(13, 110, 253, 0.26);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 12px 26px rgba(13, 110, 253, 0.16);
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.97rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .instruction-steps li {
    background: rgba(18, 24, 40, 0.78);
}

.instruction-steps li::before {
    content: counter(instruction);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.24), rgba(124, 105, 255, 0.26));
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.34);
}

.instruction-steps li::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(13, 110, 253, 0.18), transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.instruction-steps li:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(13, 110, 253, 0.2);
    border-color: rgba(13, 110, 253, 0.4);
}

.instruction-steps li:hover::after {
    opacity: 1;
}

.instruction-step-text {
    position: relative;
    z-index: 1;
    color: var(--text-primary);
    display: block;
}

.instruction-step-text strong {
    color: var(--accent-primary);
}

/* Common Mistakes */
.mistakes-section {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(255, 116, 116, 0.7), rgba(124, 105, 255, 0.55)) border-box;
    box-shadow: 0 22px 44px rgba(255, 116, 116, 0.2);
}

[data-theme="dark"] .mistakes-section {
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(255, 139, 139, 0.62), rgba(124, 105, 255, 0.5)) border-box;
    box-shadow: 0 22px 46px rgba(255, 139, 139, 0.22);
}

.mistakes-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(130% 130% at 0% 0%, rgba(255, 116, 116, 0.24), transparent 60%),
        radial-gradient(130% 130% at 100% 100%, rgba(124, 105, 255, 0.2), transparent 60%);
    pointer-events: none;
    opacity: 0.65;
}

.mistakes-section .section-icon-wrapper {
    background: rgba(255, 116, 116, 0.22);
    color: #ff6b6b;
    box-shadow: inset 0 0 0 1px rgba(255, 116, 116, 0.38);
}

[data-theme="dark"] .mistakes-section .section-icon-wrapper {
    background: rgba(255, 139, 139, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 139, 139, 0.4);
}

.mistake-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mistake-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.85rem;
    padding: 1.05rem 1.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 116, 116, 0.32);
    position: relative;
    backdrop-filter: blur(6px);
    color: var(--text-secondary);
    line-height: 1.58;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

[data-theme="dark"] .mistake-steps li {
    background: rgba(18, 24, 40, 0.78);
}

.mistake-steps li::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(255, 116, 116, 0.28), transparent 70%);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.mistake-steps li:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(255, 116, 116, 0.26);
    border-color: rgba(255, 116, 116, 0.48);
}

.mistake-steps li:hover::before {
    opacity: 1;
}

.mistake-icon {
    font-size: 1.35rem;
    color: #ff6b6b;
    position: relative;
    z-index: 1;
    line-height: 1;
    margin-top: 0.2rem;
}

.mistake-text {
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

.mistake-text strong {
    color: #ff6b6b;
}

/* Insights */
.insights-section {
    position: relative;
    border: 1px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(103, 232, 249, 0.5), rgba(124, 105, 255, 0.5)) border-box;
    box-shadow: 0 22px 48px rgba(14, 165, 233, 0.18);
}

[data-theme="dark"] .insights-section {
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(56, 189, 248, 0.55), rgba(124, 105, 255, 0.5)) border-box;
}

.insights-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(140% 140% at 0% 0%, rgba(103, 232, 249, 0.18), transparent 60%),
        radial-gradient(140% 140% at 100% 100%, rgba(124, 105, 255, 0.18), transparent 60%);
    pointer-events: none;
    opacity: 0.55;
}

.section-icon-wrapper.insights-icon {
    background: rgba(56, 189, 248, 0.22);
    color: rgba(14, 165, 233, 0.95);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.insights-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(103, 232, 249, 0.28);
    padding: 1.6rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    backdrop-filter: blur(10px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

[data-theme="dark"] .insights-card {
    background: rgba(17, 24, 39, 0.8);
}

.insights-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(14, 165, 233, 0.25);
    border-color: rgba(103, 232, 249, 0.45);
}

.insight-card-icon {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    color: rgba(14, 165, 233, 0.95);
    background: rgba(56, 189, 248, 0.18);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.insight-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    color: var(--text-secondary);
}

.insight-card-body h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.primary-muscle {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.secondary-muscles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.secondary-muscles span {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

[data-theme="dark"] .secondary-muscles span {
    background: rgba(255, 255, 255, 0.06);
}

.no-secondary {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.equipment-type {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.equipment-note {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.btn-watch-video {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.35rem;
    border-radius: 14px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(124, 105, 255, 0.92));
    color: #06111b;
    text-decoration: none;
    font-weight: 600;
    width: fit-content;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-watch-video:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(56, 189, 248, 0.35);
    color: #06111b;
}

/* Activation */
.activation-section {
    position: relative;
    border: 1px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(45, 212, 191, 0.6), rgba(124, 105, 255, 0.45)) border-box;
    box-shadow: 0 22px 48px rgba(45, 212, 191, 0.2);
}

[data-theme="dark"] .activation-section {
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(45, 212, 191, 0.5), rgba(124, 105, 255, 0.5)) border-box;
}

.activation-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(130% 130% at 0% 0%, rgba(45, 212, 191, 0.18), transparent 60%),
        radial-gradient(130% 130% at 100% 100%, rgba(124, 105, 255, 0.18), transparent 60%);
    pointer-events: none;
    opacity: 0.52;
}

.section-icon-wrapper.activation-icon {
    background: rgba(45, 212, 191, 0.22);
    color: rgba(13, 148, 136, 0.95);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.35);
}

.activation-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    z-index: 1;
}

.activation-row {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.15rem 1.35rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.26);
    backdrop-filter: blur(8px);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

[data-theme="dark"] .activation-row {
    background: rgba(17, 24, 39, 0.78);
}

.activation-row:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 212, 191, 0.45);
    box-shadow: 0 18px 36px rgba(45, 212, 191, 0.2);
}

.activation-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.activation-label .muscle-name {
    color: var(--text-primary);
    font-size: 1.05rem;
}

.activation-label .activation-percent {
    color: rgba(13, 148, 136, 0.9);
    font-size: 0.95rem;
}

.activation-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    height: 12px;
    overflow: hidden;
}

.activation-fill {
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.95), rgba(124, 105, 255, 0.85));
    height: 100%;
    border-radius: 14px;
    transition: width 0.4s ease;
}

/* Responsive */
@media (max-width: 1100px) {
    .exercise-detail-hero {
        grid-template-columns: minmax(0, 1fr);
        text-align: center;
    }

    .hero-overview {
        align-items: center;
    }

    .hero-title-block {
        text-align: center;
        align-items: center;
    }

    .hero-title-block p {
        max-width: 40ch;
    }

    .hero-tags {
        justify-content: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-media {
        justify-content: center;
    }

    .hero-media::before {
        inset: 8% -12% -16% -12%;
    }
}

@media (max-width: 992px) {
    .exercise-detail-page {
        padding: 2.2rem 1.4rem 3.4rem;
    }

    .detail-section {
        padding: 1.85rem;
    }

    .insights-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .exercise-detail-page {
        padding: 2rem 1.25rem 3rem;
    }

    .exercise-detail-hero {
        padding: 2.1rem 1.75rem;
    }

    .detail-section {
        padding: 1.6rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .instruction-steps li {
        padding: 1.05rem 1.2rem 1.05rem 3.4rem;
        border-radius: 18px;
    }

    .instruction-steps li::before {
        left: 1rem;
        width: 2.4rem;
        height: 2.4rem;
        font-size: 0.95rem;
    }

    .mistake-steps li {
        grid-template-columns: 1fr;
        padding: 0.95rem 1rem;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .activation-row {
        padding: 1rem 1.1rem;
    }
}

@media (max-width: 576px) {
    .exercise-detail-page {
        padding: 1.8rem 1rem 2.6rem;
    }

    .exercise-detail-hero {
        padding: 1.85rem 1.35rem;
    }

    .section-icon-wrapper {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.2rem;
        border-radius: 16px;
    }

    .section-icon-wrapper.instructions-icon,
    .section-icon-wrapper.insights-icon,
    .section-icon-wrapper.activation-icon {
        width: 2.6rem;
        height: 2.6rem;
        font-size: 1.15rem;
    }

    .instruction-steps {
        gap: 0.95rem;
    }

    .instruction-steps li {
        padding: 0.95rem 1.05rem 0.95rem 3.1rem;
    }

    .instruction-steps li::before {
        width: 2.2rem;
        height: 2.2rem;
    }

    .mistake-steps {
        gap: 0.85rem;
    }

    .mistake-steps li {
        padding: 0.85rem 0.95rem;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .activation-fill,
    .btn-watch-video,
    .btn-add-to-workout-detail,
    .instruction-steps li,
    .mistake-steps li,
    .insights-card,
    .hero-tag,
    .btn-back,
    .btn-back-link {
        transition: none !important;
    }
}
