/**
 * Engagement Standing Styles
 * Monochromatic, elegant design for peer comparison
 * OS 25-Oct-2025
 */

/* ============================================
   Page Container
   ============================================ */

.engagement-standing-page {
    min-height: 100vh;
    background: #f0ece8;
    padding: 60px 20px;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   Header
   ============================================ */

.engagement-header {
    max-width: 1200px;
    margin: 0 auto 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.engagement-header-content {
    flex: 1;
}

.engagement-title {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    letter-spacing: -0.02em;
}

.engagement-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #666;
    margin: 0;
    letter-spacing: 0.01em;
}

/* ============================================
   Filters
   ============================================ */

.engagement-filters {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Time Period Tabs */
.time-period-tabs {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: #f5f5f5;
    border-radius: 10px;
}

.period-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.period-tab:hover {
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.5);
}

.period-tab.active {
    background: white;
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.period-tab:focus {
    outline: none;
}

/* ============================================
   Loading State
   ============================================ */

.engagement-loading {
    text-align: center;
    padding: 100px 20px;
}

.engagement-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.engagement-loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: engagement-spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.engagement-loader-ring:nth-child(1) {
    animation-delay: -0.45s;
}

.engagement-loader-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #555;
}

.engagement-loader-ring:nth-child(3) {
    animation-delay: -0.15s;
    border-top-color: #999;
}

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

.engagement-loading p {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* ============================================
   Error State
   ============================================ */

.engagement-error {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.engagement-error h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
}

.engagement-error p {
    font-size: 16px;
    color: #666;
    margin: 0 0 30px 0;
}

.engagement-error .btn {
    display: inline-block;
    padding: 12px 30px;
    background: #1a1a1a;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.engagement-error .btn:hover {
    background: #333;
    transform: translateY(-1px);
}

/* ============================================
   Main Content
   ============================================ */

.engagement-main {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   Category Cards
   ============================================ */

.engagement-category {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.engagement-category:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Overall Score - Full Width */
.engagement-category.overall-score {
    background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
    border: 2px solid #e5e5e5;
}

.engagement-category.overall-score .category-header h2 {
    font-size: 24px;
}

.engagement-category.overall-score .score-value {
    font-size: 36px;
}

/* Other Categories - Grid Layout */
.engagement-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.engagement-categories-grid .engagement-category {
    margin-bottom: 0;
    padding: 25px;
}

.category-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.category-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 5px 0;
    letter-spacing: -0.01em;
}

.category-header p {
    font-size: 12px;
    color: #777;
    margin: 0;
}

/* ============================================
   Score Comparison
   ============================================ */

.score-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.score-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777;
}

.score-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.overall-score .score-value {
    font-size: 36px;
}

.your-score .score-value {
    color: #1a1a1a;
}

.peer-score .score-value {
    color: #666;
}

/* ============================================
   Score Bars
   ============================================ */

.score-bar {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a1a1a 0%, #444 100%);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.peer-score .score-fill {
    background: linear-gradient(90deg, #999 0%, #bbb 100%);
}

/* ============================================
   Percentile Info
   ============================================ */

.percentile-info {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    margin-top: 20px;
}

.percentile-info span {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Above/Below Average Indicator */
.performance-indicator {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    font-weight: 400;
    padding: 10px;
}

.performance-indicator.above {
    color: #28a745;
}

.performance-indicator.below {
    color: #dc3545;
}

.performance-indicator.at {
    color: #666;
}

/* ============================================
   Score Statistics
   ============================================ */

.score-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.overall-score .score-stats {
    gap: 20px;
    padding-top: 20px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
}

.overall-score .stat-label {
    font-size: 12px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.overall-score .stat-value {
    font-size: 24px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 968px) {
    .engagement-categories-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .engagement-standing-page {
        padding: 40px 15px;
    }
    
    .engagement-title {
        font-size: 32px;
    }
    
    .engagement-subtitle {
        font-size: 16px;
    }
    
    .engagement-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .engagement-filters {
        width: 100%;
    }
    
    .time-period-tabs {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .period-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
    
    .engagement-category {
        padding: 25px;
    }
    
    .engagement-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-header h2 {
        font-size: 18px;
    }
    
    .score-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .score-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .score-value {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .engagement-title {
        font-size: 28px;
    }
    
    .engagement-category {
        padding: 20px;
    }
    
    .score-value {
        font-size: 24px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================
   Above/Below Average Indicators
   ============================================ */

.above-average {
    color: #1a1a1a !important;
}

.below-average {
    color: #999 !important;
}

.at-average {
    color: #666 !important;
}

/* ==========================================================================
   Age Range Selector - Engagement Page
   OS 16-Nov-2025
   ========================================================================== */

.engagement-age-selector {
    max-width: 1200px;
    margin: 0 auto 30px;
    background: #f8f9fa;
    padding: 28px 32px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

/* Reuse all the slider styles from brain-map */
.engagement-age-selector .age-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.engagement-age-selector .age-range-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.engagement-age-selector .range-symbol {
    font-size: 24px;
    color: #666;
}

.engagement-age-selector #engagement-range-value {
    font-size: 36px;
    font-weight: 800;
    transition: all 0.2s ease;
}

.engagement-age-selector .range-unit {
    font-size: 16px;
    font-weight: 500;
    color: #666;
    margin-left: 4px;
}

/* All Ages Toggle */
.engagement-age-selector .all-ages-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
}

.engagement-age-selector .all-ages-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.engagement-age-selector .all-ages-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #1a1a1a;
}

.engagement-age-selector .all-ages-toggle span {
    font-size: 15px;
    font-weight: 600;
    color: #495057;
}

/* Slider Container */
.engagement-age-selector .slider-container {
    position: relative;
    padding: 24px 0 40px;
    margin: 0;
}

/* Custom Slider */
.engagement-age-selector .age-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    background: transparent;
    outline: none;
    position: relative;
    z-index: 2;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.engagement-age-selector .age-slider::-webkit-slider-runnable-track {
    background: transparent;
    height: 8px;
    border: none;
}

.engagement-age-selector .age-slider::-moz-range-track {
    background: transparent;
    height: 8px;
    border: none;
}

/* Track Background */
.engagement-age-selector .slider-track-bg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #e9ecef 0%, #1a1a1a 100%);
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
    transform: translateY(-50%);
}

/* WebKit Thumb */
.engagement-age-selector .age-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    background: #1a1a1a;
    border: 4px solid white;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

}

.engagement-age-selector .age-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.engagement-age-selector .age-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Firefox Thumb */
.engagement-age-selector .age-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: #1a1a1a;
    border: 4px solid white;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.engagement-age-selector .age-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.engagement-age-selector .age-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Tick Marks */
.engagement-age-selector .slider-ticks {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 0;
    transform: translateY(-50%);
}

.engagement-age-selector .tick {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.engagement-age-selector .tick:first-child {
    align-items: flex-start;
}

.engagement-age-selector .tick:last-child {
    align-items: flex-end;
}

.engagement-age-selector .tick-mark {
    width: 3px;
    height: 16px;
    background: #1a1a1a;
    border-radius: 2px;
    transform: translateY(-4px);
}

.engagement-age-selector .tick-label {
    position: absolute;
    top: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

/* Age Range Info */
.engagement-age-selector .age-range-info {
    text-align: center;
    color: #666;
    font-size: 15px;
    padding: 14px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-top: 8px;
}

.engagement-age-selector .age-range-info strong {
    color: #1a1a1a;
    font-weight: 700;
}

/* Disabled State */
.engagement-age-selector .age-slider:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.engagement-age-selector .age-slider:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    background: #ccc;
}

.engagement-age-selector .age-slider:disabled::-moz-range-thumb {
    cursor: not-allowed;
    background: #ccc;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .engagement-age-selector {
        padding: 20px 24px;
    }
    
    .engagement-age-selector .age-range-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .engagement-age-selector .age-range-value {
        font-size: 24px;
    }
    
    .engagement-age-selector #engagement-range-value {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .engagement-age-selector .age-range-value {
        font-size: 20px;
    }
    
    .engagement-age-selector #engagement-range-value {
        font-size: 28px;
    }
}

