/**
 * MyAthletiq Brand Styles
 * Inspired by Elevate Studios design system
 */

:root {
    /* Brand Colors */
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gold: #a98b53;

    /* Opacity variants */
    --color-white-10: rgba(255, 255, 255, 0.1);
    --color-white-15: rgba(255, 255, 255, 0.15);
    --color-white-50: rgba(255, 255, 255, 0.5);
    --color-white-60: rgba(255, 255, 255, 0.6);
    --color-white-90: rgba(255, 255, 255, 0.9);

    --color-black-50: rgba(0, 0, 0, 0.5);
    --color-black-80: rgba(0, 0, 0, 0.8);

    /* Typography */
    --font-family: system-ui, Arial, sans-serif;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 900;

    /* Spacing */
    --letter-spacing-wide: 0.08em;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Global typography */
body {
    font-family: var(--font-family);
}

/* Heading styles with Elevate Studios aesthetic */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-extrabold);
}

/* Gold accent utilities */
.text-gold {
    color: var(--color-gold);
}

.bg-gold {
    background-color: var(--color-gold);
}

.border-gold {
    border-color: var(--color-gold);
}

.hover\:text-gold:hover {
    color: var(--color-gold);
}

.hover\:bg-gold:hover {
    background-color: var(--color-gold);
}

.hover\:border-gold:hover {
    border-color: var(--color-gold);
}

/* Black background utilities */
.bg-black {
    background-color: var(--color-black);
}

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

/* Interactive elements with gold accent */
.btn-gold {
    background-color: var(--color-gold);
    color: var(--color-black);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-normal);
}

.btn-gold:hover {
    background-color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(169, 139, 83, 0.3);
}

.btn-gold-outline {
    background-color: transparent;
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-normal);
}

.btn-gold-outline:hover {
    background-color: var(--color-gold);
    color: var(--color-black);
    transform: translateY(-2px);
}

/* Link styles with gold accent */
.link-gold {
    color: var(--color-white);
    transition: color var(--transition-fast);
}

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

/* Border utilities */
.border-active-gold {
    border-bottom: 2px solid var(--color-gold);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Animations inspired by Elevate Studios */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes goldShimmer {
    0%, 100% {
        background-position: -100% 0;
    }
    50% {
        background-position: 200% 0;
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-in both;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Image choice cards for questionnaire questions with visual options */
.image-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.image-choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px solid var(--color-white-15);
    background: var(--color-white-10);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.image-choice-card:hover {
    border-color: var(--color-gold);
    background: var(--color-white-15);
    transform: translateY(-2px);
}

.image-choice-card.selected,
.image-choice-card:has(input:checked) {
    border-color: var(--color-gold);
    background: rgba(169, 139, 83, 0.15);
    box-shadow: 0 0 0 1px var(--color-gold);
}

.image-choice-img {
    width: 100%;
    max-width: 120px;
    height: auto;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
}

.image-choice-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-white-90);
    line-height: 1.3;
}

/* Mobile: 2 columns minimum */
@media (max-width: 480px) {
    .image-choice-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .image-choice-card {
        padding: 0.75rem;
    }

    .image-choice-img {
        max-width: 80px;
    }

    .image-choice-label {
        font-size: 0.75rem;
    }
}

/* =====================================================
   Questionnaire Mobile Responsiveness
   ===================================================== */

/* Rating scale: ensure minimum 44px touch targets */
.rating-scale-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rating-scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.rating-scale-circle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.875rem;
    -webkit-tap-highlight-color: transparent;
}

.rating-scale-item input:checked + .rating-scale-circle {
    border-color: #2563eb;
    background-color: #2563eb;
    color: #fff;
}

.rating-scale-item:hover .rating-scale-circle {
    border-color: #60a5fa;
}

/* Checkbox/radio: minimum 44px touch targets */
.choice-label {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    min-height: 44px;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: #1f2937;
    -webkit-tap-highlight-color: transparent;
}

.choice-label:hover {
    border-color: #93c5fd;
}

.choice-label:active {
    background: #eff6ff;
}

.choice-input {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
}

.choice-text {
    margin-left: 0.75rem;
    font-size: 1rem;
    line-height: 1.4;
}

/* Boolean buttons: ensure touch-friendly */
.boolean-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.boolean-option:active {
    transform: scale(0.98);
}

/* Auto-save indicator: mobile-visible */
.save-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.save-indicator--hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.save-indicator--visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section card mobile padding */
@media (max-width: 640px) {
    .section-card {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }

    .section-card h2 {
        font-size: 1.25rem !important;
    }

    .section-card > .space-y-16 {
        --tw-space-y-reverse: 0;
        margin-top: 0;
    }

    /* Reduce spacing between questions on mobile */
    .section-card .question-wrapper {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    /* Rating scale: tighter layout on small screens */
    .rating-scale-container {
        gap: 0.375rem;
    }

    .rating-scale-circle {
        width: 44px;
        height: 44px;
        font-size: 0.8125rem;
    }

    /* Header card mobile padding */
    .questionnaire-header {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    .questionnaire-header h1 {
        font-size: 1.5rem !important;
    }
}

/* Very small screens (iPhone SE, 375px) */
@media (max-width: 400px) {
    .rating-scale-circle {
        width: 40px;
        height: 40px;
        font-size: 0.75rem;
    }

    .rating-scale-container {
        gap: 0.25rem;
    }

    .choice-label {
        padding: 0.75rem;
    }
}

/* Prevent horizontal scrolling globally in questionnaire */
.questionnaire-form-container {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Text areas: comfortable mobile sizing */
.questionnaire-textarea {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS zoom on focus */
}

/* All text inputs: prevent iOS zoom */
.questionnaire-input {
    font-size: 16px; /* Prevents iOS zoom on focus */
}

/* Top progress bar */
#top-progress-bar {
    transition: box-shadow 0.3s ease;
}

#top-progress-bar.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Hide top progress bar in wizard mode — wizard has its own progress */
.wizard-active #top-progress-bar {
    display: none !important;
}

/* Sticky footer mobile adjustments */
@media (max-width: 640px) {
    .questionnaire-footer {
        padding: 0.75rem !important;
    }

    .questionnaire-footer .submit-btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
}

/* Wizard mode mobile adjustments */
@media (max-width: 640px) {
    .wizard-active .question-wrapper {
        padding-top: 120px !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .wizard-navigation {
        padding: 0.75rem !important;
        min-height: auto !important;
    }

    .wizard-btn {
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

/* Gold shimmer effect for special headings */
.gold-shimmer {
    background: linear-gradient(
        90deg,
        var(--color-white) 0%,
        var(--color-gold) 50%,
        var(--color-white) 100%
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldShimmer 4s linear infinite;
}
