/* ==========================================
   HYROX WORKOUT GENERATOR - STYLES
   ========================================== */

/* Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --text-primary: #f5f5f5;
    --text-secondary: #888888;
    --accent: #ff4d00;
    --accent-dim: #cc3d00;
    --border: #2a2a2a;
    --success: #22c55e;
}

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

body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
}

.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 5rem);
    letter-spacing: 0.15em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.logo span {
    color: var(--accent);
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 300;
}

/* Sections */
.section {
    margin-bottom: 50px;
}

.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent);
}

/* Training Focus Selector */
.focus-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.focus-option {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.focus-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.focus-option:hover {
    border-color: var(--text-secondary);
}

.focus-option.active {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.focus-option.active::before {
    transform: scaleX(1);
}

.focus-option input {
    display: none;
}

.focus-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.focus-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.focus-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* 1RM Inputs */
.rm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.rm-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rm-input label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rm-input input {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    width: 100%;
    transition: border-color 0.2s ease;
}

.rm-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.rm-input input::placeholder {
    color: var(--text-secondary);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
}

.unit-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.unit-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 20px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.unit-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    background: var(--accent);
    border: none;
    color: var(--text-primary);
    padding: 20px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:hover {
    background: var(--accent-dim);
}

.generate-btn:active {
    transform: scale(0.98);
}

/* Workout Display */
.workout-container {
    margin-top: 50px;
    display: none;
}

.workout-container.visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.workout-meta {
    display: flex;
    gap: 24px;
}

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

.meta-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: var(--accent);
}

.meta-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.workout-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    overflow: hidden;
}

.block-header {
    background: var(--bg-secondary);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.block-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.08em;
}

.block-type {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: rgba(255, 77, 0, 0.1);
    padding: 4px 10px;
}

.exercise-list {
    padding: 20px;
}

.exercise {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.exercise:last-child {
    border-bottom: none;
}

.exercise-name {
    font-weight: 400;
}

.exercise-details {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.exercise-weight {
    color: var(--accent);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.exercise-percentage {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 4px;
}

.rest-note {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

/* Info Icon & Modal */
.info-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 12px;
    transition: all 0.2s ease;
}

.info-trigger:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-modal.visible {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.info-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.info-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.1em;
}

.info-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.info-close:hover {
    color: var(--accent);
}

.info-body {
    padding: 20px;
}

.info-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-term {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.info-definition {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Include Workout Types */
.include-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.include-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.include-option:hover {
    border-color: var(--text-secondary);
}

.include-option.active {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.include-option input {
    display: none;
}

.include-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.include-option.active .include-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}

.include-checkbox::after {
    content: '✓';
    color: var(--bg-primary);
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.include-option.active .include-checkbox::after {
    opacity: 1;
}

.include-label {
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

/* PWA Install Banner */
.install-banner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 16px 20px;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: slideUp 0.3s ease;
}

.install-banner.visible {
    display: flex;
}

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

.install-text {
    font-size: 0.9rem;
}

.install-text strong {
    color: var(--accent);
}

.install-buttons {
    display: flex;
    gap: 10px;
}

.install-btn {
    background: var(--accent);
    border: none;
    color: var(--text-primary);
    padding: 10px 20px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.install-btn:hover {
    background: var(--accent-dim);
}

.install-btn.dismiss {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.install-btn.dismiss:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Exercise Selector Panel */
.exercise-panel-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 20px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.exercise-panel-trigger:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.exercise-panel-trigger svg {
    width: 18px;
    height: 18px;
}

.exercise-count {
    margin-left: auto;
    background: var(--accent);
    color: var(--text-primary);
    padding: 2px 8px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.exercise-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
}

.exercise-panel-overlay.visible {
    display: block;
}

.exercise-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100%;
    height: 100%;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    z-index: 1002;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.exercise-panel.visible {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.panel-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
}

.panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.panel-close:hover {
    color: var(--accent);
}

.panel-controls {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.panel-btn {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.panel-search {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.panel-search input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 15px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.panel-search input:focus {
    outline: none;
    border-color: var(--accent);
}

.panel-search input::placeholder {
    color: var(--text-secondary);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.exercise-category {
    border-bottom: 1px solid var(--border);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: background 0.2s ease;
}

.category-header:hover {
    background: var(--bg-card);
}

.category-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-count {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.category-toggle {
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.category-header.expanded .category-toggle {
    transform: rotate(180deg);
}

.category-exercises {
    display: none;
    padding: 10px 20px;
    background: var(--bg-primary);
}

.category-exercises.visible {
    display: block;
}

.exercise-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.exercise-item:last-child {
    border-bottom: none;
}

.exercise-item.disabled {
    opacity: 0.4;
}

.exercise-item-checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.exercise-item.enabled .exercise-item-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}

.exercise-item-checkbox::after {
    content: '✓';
    color: var(--bg-primary);
    font-size: 0.7rem;
    opacity: 0;
}

.exercise-item.enabled .exercise-item-checkbox::after {
    opacity: 1;
}

.exercise-item-name {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.exercise-item-details {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.panel-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.panel-footer-btn {
    width: 100%;
    background: var(--accent);
    border: none;
    color: var(--text-primary);
    padding: 14px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.panel-footer-btn:hover {
    background: var(--accent-dim);
}

/* Responsive */
@media (max-width: 600px) {
    .focus-selector {
        grid-template-columns: 1fr;
    }

    .workout-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

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

    .install-banner {
        flex-direction: column;
        text-align: center;
    }

    .exercise-panel {
        width: 100%;
        right: -100%;
    }

    .exercise-panel.visible {
        right: 0;
    }

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

    .exercise-panel-trigger {
        flex-wrap: wrap;
    }

    .exercise-count {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        text-align: center;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
