/* Body Metrics Capture - Compact Chat-box Style */

:root {
    /* Neon Orange Theme Colors - Matching index.html */
    --neon-orange: #FF6B00;
    --hot-pink: #FF0080;
    --electric-blue: #00D4FF;
    --deep-purple: #5D00FF;
    --white: #FFFFFF;
    --black: #0A0A0A;
    --gray-dark: #1A1A1A;
    --gray-medium: #2A2A2A;
    --gray-light: #CCCCCC;
    
    /* Light mode overrides */
    --bg-primary: var(--white);
    --bg-secondary: #F8F8F8;
    --bg-tertiary: #EEEEEE;
    --text-primary: var(--black);
    --text-secondary: #555555;
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Dark mode variables */
[data-theme="dark"] {
    --bg-primary: var(--black);
    --bg-secondary: var(--gray-dark);
    --bg-tertiary: var(--gray-medium);
    --text-primary: var(--white);
    --text-secondary: var(--gray-light);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Main Container - Compact Chat-box Style */
.body-metrics-capture {
    max-width: 600px;
    margin: 2rem auto;
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

/* Header Section */
.section-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1E293B; /* Ensure black text */
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.02em;
}

/* Dark mode title color */
[data-theme="dark"] .section-title {
    color: #F1F5F9;
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

/* Unit Toggle - Compact Style */
.unit-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 0;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 4px;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.unit-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

.unit-btn.active {
    background: var(--neon-orange);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.unit-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Metrics Grid - Compact 2-column Layout */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Metric Group - Compact Field Styling */
.metric-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-label i {
    color: var(--neon-orange);
    font-size: 1rem;
}

.metric-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.metric-input:focus {
    outline: none;
    border-color: var(--neon-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.metric-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Height Imperial Input Group */
.height-imperial {
    display: flex;
    gap: 0.5rem;
}

.metric-input.small {
    width: 100%;
}

/* Gender Selection - Compact Button Group */
.gender-options {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.gender-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gender-btn:hover {
    border-color: var(--neon-orange);
    color: var(--text-primary);
}

.gender-btn.active {
    border-color: var(--neon-orange);
    background: var(--neon-orange);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

.gender-btn i {
    font-size: 1rem;
}

/* Body Type Section - Compact Cards */
.body-type-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.subsection-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.body-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.body-type-card {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.body-type-card:hover {
    border-color: var(--neon-orange);
    transform: translateY(-2px);
}

.body-type-card.active {
    border-color: var(--neon-orange);
    background: rgba(255, 107, 0, 0.05);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.15);
}

.body-type-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
}

.body-type-icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(50%) sepia(100%) saturate(1000%) hue-rotate(350deg);
}

.body-type-card.active .body-type-icon img {
    filter: brightness(0) saturate(100%) invert(46%) sepia(100%) saturate(2000%) hue-rotate(357deg);
}

.body-type-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.body-type-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Activity Level Section - Horizontal Slider Style */
.activity-level-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.activity-level-slider {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-orange) var(--bg-tertiary);
}

.activity-level-slider::-webkit-scrollbar {
    height: 6px;
}

.activity-level-slider::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.activity-level-slider::-webkit-scrollbar-thumb {
    background: var(--neon-orange);
    border-radius: 3px;
}

.activity-option {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.activity-option:hover {
    border-color: var(--neon-orange);
    transform: translateY(-2px);
}

.activity-option.active {
    border-color: var(--neon-orange);
    background: var(--neon-orange);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.activity-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--neon-orange);
}

.activity-option.active .activity-icon {
    color: var(--white);
}

.activity-option h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1E293B; /* Ensure black text */
}

[data-theme="dark"] .activity-option h4 {
    color: #F1F5F9;
}

.activity-option p {
    font-size: 0.75rem;
    opacity: 0.8;
    margin: 0;
    color: #475569; /* Dark gray for description */
}

[data-theme="dark"] .activity-option p {
    color: #CBD5E1;
}

.activity-option.active h4,
.activity-option.active p {
    color: var(--white);
}

/* Advanced Metrics Toggle */
.advanced-metrics {
    margin-top: 2rem;
}

.toggle-advanced {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toggle-advanced:hover {
    border-color: var(--neon-orange);
    color: var(--neon-orange);
    background: rgba(255, 107, 0, 0.05);
}

.advanced-content {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

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

/* Measurements Grid */
.measurements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.measurement-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.measurement-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.measurement-input {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

/* Stats Preview - Compact Cards */
.stats-preview {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.05), rgba(255, 107, 0, 0.1));
    border-radius: 16px;
    border: 2px solid rgba(255, 107, 0, 0.2);
    text-align: center;
}

.stats-preview .subsection-title {
    text-align: center;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neon-orange);
    margin: 0.25rem 0;
}

.stat-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-status {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.stat-status.success {
    color: #27ae60;
}

.stat-status.warning {
    color: #f39c12;
}

.stat-status.danger {
    color: #e74c3c;
}

/* Error Messages */
.error-message {
    font-size: 0.75rem;
    color: #e74c3c;
    margin-top: 0.25rem;
    display: none;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Privacy Notice */
.privacy-notice {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    justify-content: center;
}

.privacy-notice i {
    color: var(--neon-orange);
    font-size: 1rem;
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip i {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .body-metrics-capture {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .section-subtitle {
        font-size: 0.75rem;
        line-height: 1.4;
        padding: 0 1rem;
        margin-bottom: 0.5rem;
        /* Fix overlapping issues */
        position: relative;
        z-index: 1;
        background: var(--bg-secondary);
        border-radius: 8px;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .unit-toggle {
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .body-type-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .measurements-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-level-slider {
        justify-content: flex-start;
    }
}

/* Loading State */
.body-metrics-capture.loading {
    opacity: 0.6;
    pointer-events: none;
}

.body-metrics-capture.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--neon-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--neon-orange);
    outline-offset: 2px;
}

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