/* Custom Security Styles - Replaces inline styles for CSP Compliance */

/* Import Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Apply Font globally */
body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Utility Classes */
.d-none { display: none !important; }
.cursor-pointer { cursor: pointer; }
.font-lg { font-size: 1.2rem; }
.font-xl { font-size: 1.3rem; }
.font-xxl { font-size: 1.4rem; }
.font-weight-500 { font-weight: 500; }
.font-weight-600 { font-weight: 600; }
.font-weight-900 { font-weight: 900; }

/* Alert Styles */
.alert-hbr { 
    border-left: 5px solid #ffc107;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Guideline Image */
.hbr-guideline-img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: transform 0.2s;
}

.hbr-guideline-img:hover {
    transform: scale(1.01);
}

/* ARC-HBR Guideline Image */
.arc-guideline-img {
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Session Warning */
.session-warning-popup {
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

/* Citation Box */
.citation-box {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    color: #495057;
}

/* Input Fields */
.input-group-lg-text { font-size: 1.2rem; }
.input-number-lg { font-size: 1.2rem; font-weight: 600; border-radius: 6px; }
.input-unit-lg { font-size: 1.1rem; font-weight: 500; background-color: #f8f9fa; }

/* Missing Data Input Styles */
.input-missing {
    font-size: 1.2rem;
    font-weight: 600;
    border: 2px solid #ffc107;
    background-color: #fff8e1;
}
.unit-missing {
    font-size: 1.1rem;
    font-weight: 500;
    background-color: #fff8e1;
    border: 2px solid #ffc107;
    border-left: none;
}
.icon-missing {
    background-color: #fff8e1;
    border: 2px solid #ffc107;
    border-left: none;
}

/* Checkbox Switch */
.form-switch-lg { width: 3em; height: 1.5em; }
.form-check-label-lg { font-size: 1.2rem; font-weight: 500; margin-left: 0.5rem; }

/* Table Styles */
.table-th-35 { width: 35%; font-size: 1.3rem; font-weight: 600; }
.table-th-40 { width: 40%; font-size: 1.3rem; font-weight: 600; }
.table-th-10 { width: 10%; font-size: 1.3rem; font-weight: 600; }
.table-th-15 { width: 15%; font-size: 1.3rem; font-weight: 600; }
.table-cell-lg { font-size: 1.2rem; }
.score-badge { font-size: 1.1rem; padding: 0.5rem 0.8rem; border-radius: 6px; }
.arc-badge-placeholder { font-size: 0.9rem; }
.missing-list { padding-left: 1.5rem; }
.missing-list-item { margin-bottom: 0.25rem; }

/* Validation Message */
.validation-message {
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 500;
}

/* Card Improvements */
.card {
    border: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    padding: 1.5rem;
}

/* Button Improvements */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

/* ==========================================================================
   Main Page Styles (moved from inline)
   ========================================================================== */

/* Font Awesome Icon Preservation - CRITICAL for icon display */
.fas,
.far,
.fab,
.fa,
.fal,
.fad,
[class^="fa-"],
[class*=" fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "Font Awesome 5 Free" !important;
    font-weight: 900;
}

.far {
    font-weight: 400 !important;
}

.fab {
    font-family: "Font Awesome 6 Brands" !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    body,
    p,
    td,
    th,
    label,
    button,
    input,
    select,
    textarea {
        font-size: 14px !important;
    }

    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    h4 { font-size: 1.1rem !important; }
    .display-3 { font-size: 3rem !important; }
    .card { padding: 15px !important; }
    .btn { padding: 10px 15px !important; font-size: 14px !important; }
}

@media (max-width: 480px) {
    body,
    p,
    td,
    th,
    label,
    button,
    input,
    select,
    textarea {
        font-size: 12px !important;
    }

    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }
    .display-3 { font-size: 2.5rem !important; }
    .card { padding: 10px !important; }
}

/* Unit Conversion Button */
.unit-toggle-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 5px;
    transition: background 0.2s;
}

.unit-toggle-btn:hover {
    background: #5a6268;
}

/* Value Validation Styling */
.value-warning {
    border-color: #ffc107 !important;
    background-color: #fff3cd !important;
}

.value-error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.value-normal {
    border-color: #28a745 !important;
}

/* Clinical Tooltip Styling */
.info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    cursor: help;
    color: #6c757d;
}

.info-tooltip:hover {
    color: #007bff;
}

.tooltip-content {
    visibility: hidden;
    width: 300px;
    background-color: #2d3748;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

.info-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 768px) {
    .tooltip-content {
        width: 250px;
        margin-left: -125px;
    }
}

/* Feedback Section Styling */
.card-header.bg-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 2px solid #dee2e6;
}

#thumbsUpBtn:hover,
#thumbsDownBtn:hover {
    transform: scale(1.05);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#thumbsUpBtn.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border-color: #1c7430;
    animation: successPulse 0.6s ease-in-out;
}

#thumbsDownBtn.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #bd2130;
    animation: dangerPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes dangerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.feedback-thank-you {
    animation: fadeInUp 0.5s ease-in-out;
}

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

/* HBR Recommendations Section */
#hbr-recommendations-section {
    animation: fadeInUp 0.6s ease-in-out;
}

#hbr-recommendations-section .alert,
#hbr-recommendations-section .card-body {
    font-size: 1rem;
    line-height: 1.6;
}

#hbr-recommendations-section ul li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

#hbr-recommendations-section .card-header h5 {
    font-size: 1.15rem;
}

#hbr-recommendations-section img {
    transition: transform 0.3s ease;
    max-height: 600px;
    object-fit: contain;
}

#hbr-recommendations-section img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    #hbr-recommendations-section h4 {
        font-size: 1.25rem;
    }

    #hbr-recommendations-section ul li {
        font-size: 0.95rem;
    }

    #hbr-recommendations-section img {
        max-height: 400px;
    }
}

/* ==========================================================================
   Trade-off Analysis Page Styles (moved from inline)
   ========================================================================== */

/* Chart Container */
.chart-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

/* Factor List */
.factor-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

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

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
}

.content-hidden {
    opacity: 0.3;
    pointer-events: none;
}

/* Trade-off Page Card Styling */
.tradeoff-page .card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.tradeoff-page .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.tradeoff-page .card img {
    transition: transform 0.3s;
    cursor: pointer;
}

.tradeoff-page .card img:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .tradeoff-page .card img {
        max-height: 250px !important;
    }
}

/* Trade-off Alert Styling */
.tradeoff-page .alert-secondary {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.tradeoff-page .alert-info {
    background-color: #e7f3ff;
    border-left: 4px solid #0dcaf0;
}

/* Factor List Item Styling */
.tradeoff-page .list-group-item {
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
}

.tradeoff-page .list-group-item:hover {
    background-color: #f8f9fa;
}

/* Factor Checkbox Styling */
.tradeoff-page .form-check-input {
    width: 1.5em;
    height: 1.5em;
    margin-top: 0.1em;
}

.tradeoff-page .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

/* Trade-off Badge Styling */
.tradeoff-page .badge {
    font-size: 0.85rem;
    padding: 0.35em 0.65em;
    font-weight: 600;
}

/* Factor Label Styling */
.tradeoff-page .form-check-label {
    cursor: pointer;
    padding-left: 0.5rem;
    line-height: 1.6;
}

.tradeoff-page .form-check-label small {
    font-size: 0.95rem;
}

/* Legend Box */
.tradeoff-page .alert-light {
    font-size: 1rem;
}

/* Recommendations Section */
#recommendations-section .alert,
#recommendations-section .card-body {
    font-size: 1rem;
    line-height: 1.6;
}

#recommendations-section ul li {
    margin-bottom: 0.5rem;
}

#recommendations-section .card-header h5 {
    font-size: 1.15rem;
}
