/* Blocksmith Design System - Airbnb-Inspired Aesthetic */

:root {
    /* Primary Colors */
    --color-white: #FFFFFF;
    --color-charcoal: #222222;
    --color-hyrox-yellow: #FFD700;
    --color-hyrox-yellow-hover: #F5CC00;

    /* Accent Color - Electric Blue
       USE FOR: Active tabs (3px bottom border), icons (section/equipment/info), badge outlines
       DO NOT USE FOR: Buttons (use HYROX yellow), links, filled backgrounds, body text */
    --color-accent: #0EA5E9;
    --color-accent-hover: #0284C7;

    /* Secondary Colors */
    --color-background: #F8F8F6;
    --color-border: #EBEBEB;
    --color-border-dark: #DDDDDD;
    --color-surface: #F7F7F7;
    --color-text-secondary: #717171;
    --color-text-tertiary: #B0B0B0;

    /* Semantic Colors */
    --color-success: #10B981;
    --color-success-bg: #E8F5F1;
    --color-error: #DC2626;
    --color-error-bg: #FEF2F2;
    --color-info: #3B82F6;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;

    /* Headings */
    --font-h1-size: 28px;
    --font-h1-height: 36px;
    --font-h1-weight: 600;
    --font-h1-spacing: -0.5px;

    --font-h2-size: 20px;
    --font-h2-height: 28px;
    --font-h2-weight: 600;
    --font-h2-spacing: -0.3px;

    --font-h3-size: 18px;
    --font-h3-height: 26px;
    --font-h3-weight: 600;
    --font-h3-spacing: -0.2px;

    /* Body */
    --font-body-size: 16px;
    --font-body-height: 26px;
    --font-body-weight: 400;

    --font-small-size: 15px;
    --font-small-height: 24px;

    --font-caption-size: 14px;
    --font-caption-height: 22px;

    --font-micro-size: 13px;
    --font-micro-height: 20px;

    /* Metric Display */
    --font-metric-size: 28px;
    --font-metric-weight: 600;
    --font-metric-spacing: -0.5px;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-4xl: 48px;
    --space-5xl: 64px;
    --space-6xl: 80px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 24px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.08);
    --shadow-yellow: 0 4px 12px rgba(255, 215, 0, 0.25);
    --shadow-error: 0 4px 12px rgba(220, 38, 38, 0.25);

    /* Layout */
    --container-max: 1280px;
}

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

body {
    font-family: var(--font-primary);
    background: var(--color-background);
    color: var(--color-text-secondary);
    font-size: var(--font-body-size);
    line-height: var(--font-body-height);
    font-weight: var(--font-body-weight);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-2xl);
}

/* Main content area with proper spacing */
.main-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 80px 24px 48px;
}

@media (max-width: 640px) {
    .main-content {
        padding: 48px 24px 32px;
    }
}

/* Page content wrapper for create form */
.page-content {
    padding-top: var(--space-6xl);
    padding-bottom: var(--space-4xl);
}

@media (max-width: 640px) {
    .page-content {
        padding-top: var(--space-4xl);
        padding-bottom: var(--space-3xl);
    }
}

/* Typography Hierarchy */
h1 {
    font-size: var(--font-h1-size);
    line-height: var(--font-h1-height);
    font-weight: var(--font-h1-weight);
    letter-spacing: var(--font-h1-spacing);
    color: var(--color-charcoal);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: var(--font-h2-size);
    line-height: var(--font-h2-height);
    font-weight: var(--font-h2-weight);
    letter-spacing: var(--font-h2-spacing);
    color: var(--color-charcoal);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

h3 {
    font-size: var(--font-h3-size);
    line-height: var(--font-h3-height);
    font-weight: var(--font-h3-weight);
    letter-spacing: var(--font-h3-spacing);
    color: var(--color-charcoal);
    margin-bottom: var(--space-lg);
}

p {
    color: var(--color-text-secondary);
}

small, .caption {
    font-size: var(--font-caption-size);
    line-height: var(--font-caption-height);
    color: var(--color-text-secondary);
}

.micro {
    font-size: var(--font-micro-size);
    line-height: var(--font-micro-height);
}

/* Header Navigation (Landing Page Style) */
.page-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1002;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    padding: 16px 24px;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: var(--color-charcoal);
}

.header-logo {
    height: 32px;
    width: auto;
    display: block;
    max-height: 32px;
}

.header-text h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2xl);
}

.header-nav {
    display: flex;
    gap: var(--space-3xl);
    align-items: center;
}

.header-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--color-charcoal);
}

/* Mobile Hamburger Menu */
.menu-button {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1002;
    position: relative;
}

.menu-button span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-charcoal);
    transition: all 0.3s;
}

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

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

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

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-white);
    z-index: 1001;
    padding: 80px 24px 24px;
    overflow-y: auto;
}

.mobile-menu.active {
    display: block;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-nav a {
    color: var(--color-charcoal);
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

/* Page Title */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: var(--color-charcoal);
    margin-top: 0;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

@media (max-width: 1024px) {
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 640px) {
    .page-title {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }
}

.subtitle {
    font-size: var(--font-body-size);
    color: var(--color-text-secondary);
    font-weight: 400;
    margin-top: var(--space-sm);
}

/* Cards */
/* Individual form sections (cards) */
section.form-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

/* Outer form container - no visual styling, just layout */
#form-container {
    margin-bottom: var(--space-2xl);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.section-container {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-md);
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.form-row.single {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.form-row .form-group {
    margin-bottom: 0;
}

label, .required {
    font-size: var(--font-caption-size);
    font-weight: 600;
    color: var(--color-charcoal);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

label.required::after {
    content: '*';
    color: var(--color-error);
    margin-left: 2px;
}

/* Info Icon Tooltip */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 14px;
    color: var(--color-text-secondary);
    cursor: help;
    position: relative;
    user-select: none;
    transition: color 0.2s ease;
}

.info-icon:hover {
    color: var(--color-charcoal);
}

.info-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-charcoal);
    color: var(--color-white);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    white-space: pre-line;
    width: max-content;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.info-icon::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-charcoal);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.info-icon:hover::before,
.info-icon:hover::after,
.info-icon.tooltip-active::before,
.info-icon.tooltip-active::after {
    opacity: 1;
}

/* Mobile touch feedback */
@media (max-width: 768px) {
    .info-icon {
        font-size: 16px;
        width: 20px;
        height: 20px;
    }

    /* Header responsive */
    .page-header {
        padding: 12px 16px;
    }

    .header-nav {
        display: none;
    }

    .menu-button {
        display: flex;
    }

    /* Add more spacing between badges and arrows on mobile */
    .optional-badge {
        margin-right: var(--space-md);
    }
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
    background: var(--color-white);
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: var(--font-body-size);
    color: var(--color-charcoal);
    transition: all 0.2s ease;
    width: 100%;
}

select {
    height: 48px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23717171' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-charcoal);
    box-shadow: 0 0 0 1px var(--color-charcoal);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
    color: var(--color-text-tertiary);
}

small, .help-text {
    display: block;
    font-size: 13px;
    line-height: 18px;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

.model-info {
    display: block;
    font-size: var(--font-caption-size);
    color: var(--color-info);
    margin-top: var(--space-xs);
}

/* Buttons */
button, .btn-primary, .btn-secondary, .btn-destructive {
    font-family: var(--font-primary);
    font-size: var(--font-body-size);
    font-weight: 600;
    letter-spacing: -0.2px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    will-change: transform;
}

.btn-primary, button[type="submit"], #generate-btn {
    background: var(--color-hyrox-yellow);
    color: var(--color-charcoal);
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover, button[type="submit"]:hover, #generate-btn:hover {
    background: var(--color-hyrox-yellow-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-yellow);
}

.btn-primary:active, button[type="submit"]:active, #generate-btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-white);
    border: 1px solid var(--color-border-dark);
    color: var(--color-charcoal);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--color-charcoal);
    box-shadow: var(--shadow-lg);
}

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

.btn-destructive {
    background: var(--color-white);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.btn-destructive:hover {
    background: var(--color-error);
    color: var(--color-white);
    box-shadow: var(--shadow-error);
}

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

button:disabled, .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: var(--font-micro-size);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-active {
    background: var(--color-hyrox-yellow);
    color: var(--color-charcoal);
}

.badge-complete {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-rest {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.badge-upcoming {
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

/* Outline Badges - Electric Blue Accent */
.badge-outline {
    background: var(--color-white);
    color: var(--color-accent);
    border: 1.5px solid var(--color-accent);
}

.badge-outline:hover {
    background: rgba(14, 165, 233, 0.05);
}

/* Progress Container */
#progress-container {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.progress-header {
    margin-bottom: var(--space-2xl);
}

.progress-header h2 {
    color: var(--color-charcoal);
    border-bottom: none;
    padding-bottom: 0;
}

.progress-wrapper {
    margin-bottom: var(--space-2xl);
}

#progress-text {
    display: block;
    font-size: var(--font-h2-size);
    font-weight: var(--font-h2-weight);
    letter-spacing: var(--font-h2-spacing);
    color: var(--color-charcoal);
    margin-bottom: var(--space-md);
    text-align: center;
}

.progress-bar-container {
    background: var(--color-surface);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    width: 100%;
    background: var(--color-hyrox-yellow);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.3s ease;
    box-shadow: 0 1px 2px rgba(255, 215, 0, 0.3);
    will-change: transform;
}

#progress-message {
    font-size: var(--font-body-size);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

#humor-message {
    font-size: var(--font-small-size);
    color: var(--color-text-secondary);
    font-style: italic;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* Success Container */
#success-container {
    background: var(--color-white);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-md);
}

.success-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.success-header h2 {
    color: var(--color-success);
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: var(--space-sm);
}

.success-header p {
    color: var(--color-text-secondary);
    font-size: var(--font-body-size);
    margin: 0;
}

.summary-preview {
    margin-bottom: var(--space-2xl);
}

.summary-preview h3 {
    color: var(--color-charcoal);
    margin-bottom: var(--space-lg);
}

.summary-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    font-family: var(--font-mono);
    font-size: var(--font-small-size);
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
}

.form-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-top: var(--space-2xl);
}

.download-info {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--color-text-secondary);
    font-size: var(--font-small-size);
}

/* Error Messages */
.error-container {
    background: var(--color-error-bg);
    border: 1px solid var(--color-error);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

#error-message {
    color: var(--color-error);
    font-weight: 600;
}

/* Workout Items */
.workout-item {
    background: var(--color-background);
    border-left: 3px solid var(--color-hyrox-yellow);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: var(--space-md);
    transition: all 0.2s ease;
}

.workout-item:hover {
    background: var(--color-surface);
    transform: translateX(4px);
}

.workout-item.rest-day {
    background: var(--color-error-bg);
    border-left-color: var(--color-error);
}

.workout-title {
    font-size: var(--font-small-size);
    font-weight: 600;
    color: var(--color-charcoal);
    letter-spacing: -0.2px;
    margin-bottom: 6px;
}

.workout-details {
    font-size: var(--font-caption-size);
    color: var(--color-text-secondary);
    line-height: var(--font-caption-height);
}

/* Metric Cards */
.metric-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: var(--font-metric-size);
    font-weight: var(--font-metric-weight);
    color: var(--color-charcoal);
    letter-spacing: var(--font-metric-spacing);
}

.metric-label {
    font-size: var(--font-micro-size);
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: var(--space-sm);
}

/* Equipment Section */
.equipment-section {
    margin-bottom: var(--space-2xl);
}

.equipment-section:last-child {
    margin-bottom: 0;
}

.equipment-section h3 {
    color: var(--color-charcoal);
    font-size: var(--font-h3-size);
    font-weight: var(--font-h3-weight);
    margin-bottom: var(--space-lg);
    letter-spacing: var(--font-h3-spacing);
}

/* Simple Equipment Grid for Checkboxes */
.equipment-grid-simple {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.equipment-checkbox {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 400;
    gap: 0;
}

.equipment-checkbox:hover {
    border-color: var(--color-border-dark);
    background: var(--color-background);
}

.equipment-checkbox input[type="checkbox"] {
    margin-right: var(--space-sm);
    cursor: pointer;
    width: auto;
}

.equipment-checkbox span {
    user-select: none;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
}

.equipment-card {
    position: relative;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.equipment-card:hover {
    border-color: var(--color-border-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.equipment-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.equipment-card:has(input[type="checkbox"]:checked) {
    border-color: var(--color-hyrox-yellow);
}

.equipment-card input[type="checkbox"]:checked ~ .equipment-card-content .equipment-icon {
    transform: scale(1.1);
}

.equipment-card input[type="checkbox"]:checked ~ .equipment-card-content .equipment-name {
    color: var(--color-charcoal);
    font-weight: 600;
}

.equipment-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-sm);
    position: relative;
    transition: all 0.2s ease;
}

.equipment-icon {
    font-size: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    transition: transform 0.2s ease;
}

.equipment-name {
    font-size: var(--font-caption-size);
    font-weight: 500;
    color: var(--color-charcoal);
    line-height: 1.3;
    transition: all 0.2s ease;
}

.equipment-desc {
    font-size: var(--font-micro-size);
    color: var(--color-text-secondary);
    line-height: 1.2;
}

.equipment-card input[type="checkbox"]:checked {
    opacity: 0;
}

/* Equipment Setup Presets */
.setup-presets {
    margin-bottom: var(--space-xl);
}

.preset-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.preset-btn {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-small-size);
}

/* Week Indicator */
.week-indicator {
    font-size: var(--font-micro-size);
    color: var(--color-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Emoji Lists */
.emoji-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.emoji-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-caption-size);
    color: var(--color-text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 var(--space-lg);
    }
}

@media (max-width: 640px) {
    body {
        padding: var(--space-2xl) var(--space-lg);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    h1 {
        font-size: 24px;
        line-height: 32px;
    }

    h2 {
        font-size: 18px;
        line-height: 26px;
    }

    .form-section, .section-container {
        padding: var(--space-lg);
    }

    #progress-container, #success-container {
        padding: var(--space-2xl);
    }

    .form-actions {
        flex-direction: column;
    }

    button, .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-charcoal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-secondary);
}

.text-error {
    color: var(--color-error);
}

.text-success {
    color: var(--color-success);
}

.hidden {
    display: none !important;
}

/* Spacing Utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* ============================================
   SECTIONED FORM STYLES (New Form Design)
   ============================================ */

/* Section Cards with Completion Tracking */
.section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: var(--space-xs);
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.section-icon {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
}

.section-title {
    font-size: var(--font-h2-size);
    font-weight: var(--font-h2-weight);
    letter-spacing: var(--font-h2-spacing);
    color: var(--color-charcoal);
    line-height: 1.2;
    margin: 0;
    padding: 0;
    border: none;
}

.section-subtitle {
    color: var(--color-text-secondary);
    font-size: var(--font-small-size);
    margin-bottom: var(--space-2xl);
}

.completion-badge {
    display: none;
    width: 24px;
    height: 24px;
    background: var(--color-success);
    color: var(--color-white);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: var(--font-caption-size);
    font-weight: 600;
}

.section.completed .completion-badge {
    display: block;
}

/* Info Icon with Tooltip */
.label-with-info {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--color-accent);
    color: var(--color-white);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
    position: relative;
    transition: all 0.2s ease;
}

.info-icon:hover {
    background: var(--color-accent-hover);
    color: var(--color-white);
}

.tooltip-content {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    background: var(--color-charcoal);
    color: var(--color-white);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    width: 400px;
    max-width: 90vw;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    font-size: var(--font-small-size);
    line-height: 1.5;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--color-charcoal);
}

.info-icon.active .tooltip-content {
    display: block;
}

.tooltip-content h4 {
    margin: 0 0 var(--space-sm) 0;
    font-size: var(--font-small-size);
    color: var(--color-hyrox-yellow);
}

.tooltip-content p {
    margin: 0 0 var(--space-md) 0;
}

.tooltip-content p:last-child {
    margin-bottom: 0;
}

.phase-name {
    font-weight: 700;
    color: var(--color-hyrox-yellow);
}

/* Collapsible Sections */
.collapsible-section {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-2xl);
}

.collapsible-header {
    background: transparent;
    padding: var(--space-2xl);
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-sm);
}

/* Remove open state border */
.collapsible-section.open .collapsible-header {
    /* No border or extra spacing when open */
}

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

.collapsible-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.collapsible-title-text {
    font-size: var(--font-h2-size);
    font-weight: var(--font-h2-weight);
    letter-spacing: var(--font-h2-spacing);
    color: var(--color-charcoal);
    line-height: 1.2;
}

.optional-badge {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    padding: 2px var(--space-sm);
    border-radius: 4px;
    font-size: var(--font-micro-size);
    font-weight: 600;
    margin-left: var(--space-sm);
}

.collapsible-preview {
    font-size: var(--font-small-size);
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.collapsible-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
    color: var(--color-text-tertiary);
}

.collapsible-section.open .collapsible-arrow {
    transform: rotate(90deg);
}

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

.collapsible-section.open .collapsible-content {
    max-height: 3000px;
}

.collapsible-inner {
    padding: 0 var(--space-2xl) var(--space-2xl);
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.radio-item {
    display: flex;
    align-items: center;
}

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: var(--space-sm);
    cursor: pointer;
}

.radio-item label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: var(--space-xs);
}

.toggle-label {
    font-weight: 500;
    color: var(--color-charcoal);
}

.toggle-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--color-border-dark);
    border-radius: 14px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: var(--color-white);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-container:hover .toggle-switch {
    background: var(--color-border-dark);
    filter: brightness(0.95);
}

.toggle-container input[type="checkbox"]:checked + .toggle-switch {
    background: var(--color-info);
}

.toggle-container input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(24px);
}

.toggle-container:hover input[type="checkbox"]:checked + .toggle-switch {
    background: var(--color-info);
    filter: brightness(0.9);
}

.toggle-container input[type="checkbox"]:focus + .toggle-switch {
    outline: 2px solid var(--color-info);
    outline-offset: 2px;
}

/* Submit Container */
.submit-container {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-2xl);
}

.submit-container button {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
}

/* Mobile Adjustments for New Form Elements */
@media (max-width: 640px) {
    #form-container,
    #progress-container {
        max-width: 100%;
    }

    .section {
        padding: var(--space-lg);
    }

    .collapsible-inner {
        padding: var(--space-lg);
    }

    .section-header {
        padding-bottom: var(--space-md);
    }

    .section-icon {
        font-size: 24px;
    }

    .tooltip-content {
        width: 320px;
        left: auto;
        right: 0;
        transform: none;
    }

    .submit-container {
        padding: var(--space-lg);
    }

    .submit-container button {
        font-size: 16px;
    }
}

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

/* ============================================
   EDUCATION CARDS FOR PROGRESS PAGE
   ============================================ */

/* Education Section Container */
.education-section {
    margin-top: 60px;
}

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

/* Card Stack Container */
.card-stack-container {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
}

.card-stack {
    position: relative;
    height: 400px;
    perspective: 1000px;
}

/* Individual Education Card */
.education-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl);
    box-shadow: var(--shadow-lg);
    cursor: grab;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.education-card:active {
    cursor: grabbing;
}

/* Card States - These control the stacked appearance */
.education-card.card-current {
    z-index: 3;
    transform: translateX(0) scale(1) rotateY(0deg);
    opacity: 1;
}

.education-card.card-next {
    z-index: 2;
    transform: translateX(40px) scale(0.92) rotateY(-8deg);
    opacity: 0.5;
    pointer-events: none;
}

.education-card.card-prev {
    z-index: 2;
    transform: translateX(-40px) scale(0.92) rotateY(8deg);
    opacity: 0.5;
    pointer-events: none;
}

.education-card.card-hidden {
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* Card Content Styling */
.card-category {
    display: inline-block;
    font-size: var(--font-micro-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-accent);
    background: rgba(14, 165, 233, 0.1);
    padding: 4px var(--space-md);
    border-radius: var(--radius-pill);
    margin-bottom: var(--space-lg);
}

.card-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: var(--space-lg);
}

.card-headline {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-charcoal);
    letter-spacing: -0.3px;
    line-height: 1.3;
    margin-bottom: var(--space-lg);
    max-width: 380px;
}

.card-body {
    font-size: var(--font-body-size);
    line-height: 1.6;
    color: var(--color-text-secondary);
    max-width: 420px;
}

/* Navigation Controls */
.swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xl);
    margin-top: var(--space-xl);
}

.card-nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-white);
    border: 1px solid var(--color-border-dark);
    color: var(--color-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    will-change: transform;
}

.card-nav-btn:hover:not(:disabled) {
    background: var(--color-surface);
    border-color: var(--color-charcoal);
    box-shadow: var(--shadow-lg);
}

.card-nav-btn:active:not(:disabled) {
    transform: scale(0.92);
}

.card-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.card-counter {
    font-size: var(--font-caption-size);
    font-weight: 600;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    min-width: 90px;
    text-align: center;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
    .card-stack {
        height: 360px;
    }

    .education-card {
        padding: var(--space-xl);
    }

    .card-icon {
        font-size: 40px;
    }

    .card-headline {
        font-size: 18px;
    }

    .card-body {
        font-size: var(--font-small-size);
    }

    .education-card.card-next,
    .education-card.card-prev {
        transform: translateX(20px) scale(0.94);
    }
}

/* Touch Device Optimizations */
button, a.btn, .btn-primary, .btn-secondary, .btn-destructive,
.card-nav-btn, .equipment-checkbox, .toggle-container {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (hover: none) {
    /* Remove hover-only transforms on touch devices — rely on :active instead */
    .btn-primary:hover, button[type="submit"]:hover, #generate-btn:hover {
        transform: none;
    }

    .btn-secondary:hover {
        box-shadow: var(--shadow-sm);
    }

    .btn-destructive:hover {
        background: var(--color-white);
        color: var(--color-error);
        box-shadow: none;
    }

    .card-nav-btn:hover:not(:disabled) {
        background: var(--color-white);
        box-shadow: var(--shadow-sm);
    }
}
