/* ================================
   Hôpital Foch - FIP-Score Calculator
   Custom Stylesheet
   ================================ */

   :root {
    /* Foch Colors - Based on hospital branding */
    --foch-blue: #003d82;
    --foch-light-blue: #0066cc;
    --foch-teal: #00a8a8;
    --foch-green: #28a745;
    --foch-red: #dc3545;
    --foch-orange: #ff8c00;
    
    /* Neutral Colors */
    --white: #ffffff;
    --off-white: #f8f9fa;
    --light-gray: #e9ecef;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --black: #000000;
    
    /* Functional Colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Typography */
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* ================================
   Reset & Base Styles
   ================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--dark-gray);
    background-color: var(--off-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--foch-blue);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo {
    height: 50px;
    width: auto;
}

.logo-separator {
    width: 2px;
    height: 40px;
    background: var(--light-gray);
    margin: 0 var(--spacing-sm);
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foch-blue);
    margin-bottom: 4px;
}

.header-text .subtitle {
    font-size: 0.875rem;
    color: var(--medium-gray);
    font-weight: 500;
}

.language-switch {
    display: flex;
    gap: 8px;
}

.lang-btn {
    background: var(--white);
    border: 2px solid var(--foch-blue);
    color: var(--foch-blue);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.lang-btn:hover {
    background: var(--foch-light-blue);
    border-color: var(--foch-light-blue);
    color: var(--white);
}

.lang-btn.active {
    background: var(--foch-blue);
    color: var(--white);
}

/* ================================
   Container & Sections
   ================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

section {
    margin-bottom: var(--spacing-xl);
}

/* ================================
   Intro Section
   ================================ */

.intro-section h2 {
    font-size: 1.75rem;
    color: var(--foch-blue);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
}

.warning-box {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border: 2px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.warning-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.warning-box strong {
    display: block;
    color: var(--dark-gray);
    margin-bottom: 8px;
    font-size: 1rem;
}

.warning-box p {
    color: #856404;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* ================================
   Calculator Section - Two Column Layout
   ================================ */

.calculator-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--spacing-xl);
    align-items: start;
}

.section-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.section-header h3 {
    font-size: 1.5rem;
    color: var(--foch-blue);
    margin-bottom: 8px;
    font-weight: 700;
}

.section-subtitle {
    color: var(--medium-gray);
    font-size: 0.875rem;
}

.criteria-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: 0;
}

.criterion-card {
    background: var(--off-white);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.criterion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--foch-blue);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.criterion-card:hover {
    border-color: var(--foch-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.criterion-card:hover::before {
    transform: scaleY(1);
}

.criterion-card.selected {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    border-color: var(--foch-blue);
    box-shadow: var(--shadow-sm);
}

.criterion-card.selected::before {
    transform: scaleY(1);
}

.criterion-card input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--foch-blue);
    margin: 0;
}

.criterion-content {
    flex: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.criterion-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.criterion-points {
    background: var(--foch-teal);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.criterion-title {
    font-size: 0.938rem;
    color: var(--dark-gray);
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.criterion-detail {
    font-size: 0.813rem;
    color: var(--medium-gray);
    margin: 0;
    margin-left: auto;
    white-space: nowrap;
}

/* ================================
   Result Section - Sticky Sidebar
   ================================ */

.result-sidebar {
    position: sticky;
    top: calc(var(--spacing-xl) + 80px);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.result-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 0;
}

.score-card {
    background: linear-gradient(135deg, var(--foch-blue) 0%, var(--foch-light-blue) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.score-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.reset-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--white);
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.reset-btn:hover {
    background: var(--white);
    color: var(--foch-blue);
}

.score-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: var(--spacing-md) 0;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.15s ease;
}

.score-max {
    font-size: 1.25rem;
    opacity: 0.9;
}

.score-bar {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    overflow: visible;
    margin-top: var(--spacing-md);
}

.score-bar-fill {
    height: 100%;
    background: var(--white);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.score-threshold {
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
}

.threshold-marker {
    background: var(--warning);
    color: var(--dark-gray);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-block;
}

.threshold-marker::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--warning);
}

.interpretation-card {
    background: var(--off-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.interpretation-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.interpretation-card h4 {
    font-size: 1rem;
    color: var(--foch-blue);
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
    line-height: 1.3;
}

.interpretation-card p {
    color: var(--dark-gray);
    font-size: 0.875rem;
    line-height: 1.5;
}

.recommendation-card {
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    animation: fadeIn 0.5s ease;
}

.recommendation-card.positive {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border: 2px solid var(--danger);
}

.recommendation-card.negative {
    background: linear-gradient(135deg, #f0fff4 0%, #d4f8dd 100%);
    border: 2px solid var(--success);
}

.recommendation-header h4 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}

.recommendation-card.positive h4 {
    color: var(--danger);
}

.recommendation-card.negative h4 {
    color: var(--success);
}

.recommendation-card p,
.recommendation-card ul {
    color: var(--dark-gray);
    font-size: 0.813rem;
    line-height: 1.6;
}

.recommendation-card ul {
    list-style-position: inside;
    margin-top: var(--spacing-xs);
    padding-left: var(--spacing-xs);
}

.recommendation-card li {
    margin-bottom: 6px;
}

.recommendation-card strong {
    color: var(--foch-blue);
}

/* ================================
   Info Section
   ================================ */

.info-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.info-card {
    background: var(--off-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--foch-teal);
}

.info-card h4 {
    font-size: 1.125rem;
    color: var(--foch-blue);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: var(--spacing-xs) 0;
    color: var(--dark-gray);
    font-size: 0.938rem;
    line-height: 1.6;
    position: relative;
    padding-left: 24px;
}

.info-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--foch-teal);
    font-weight: 700;
    font-size: 1.125rem;
}

.reference-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid var(--light-gray);
}

.reference-card h4 {
    font-size: 1.125rem;
    color: var(--foch-blue);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
}

.reference-text {
    font-size: 0.875rem;
    color: var(--dark-gray);
    line-height: 1.7;
}

.reference-text em {
    font-style: italic;
    color: var(--foch-blue);
}

/* ================================
   Footer
   ================================ */

.footer {
    background: var(--foch-blue);
    color: var(--white);
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h5 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    color: var(--white);
}

.footer-section p {
    font-size: 0.875rem;
    line-height: 1.7;
    opacity: 0.9;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-section a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.813rem;
    opacity: 0.8;
}

/* ================================
   Animations
   ================================ */

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

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

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-separator {
        width: 40px;
        height: 2px;
        margin: var(--spacing-xs) 0;
    }
    
    .header-text h1 {
        font-size: 1.25rem;
    }
    
    .calculator-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .result-sidebar {
        position: static;
        order: -1;
    }
    
    .criteria-grid {
        gap: var(--spacing-xs);
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    .score-max {
        font-size: 1.125rem;
    }
    
    .calculator-section,
    .result-section,
    .info-section {
        padding: var(--spacing-md);
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .criterion-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .criterion-header {
        width: 100%;
    }
    
    .criterion-detail {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .warning-box {
        flex-direction: column;
    }
    
    .score-header {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* ================================
   Print Styles
   ================================ */

@media print {
    .header,
    .footer,
    .language-switch,
    .reset-btn {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .container {
        max-width: 100%;
    }
    
    .calculator-section,
    .result-section,
    .info-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}