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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #5b92e5;
    color: white;
    padding: 30px 10px;
    margin-bottom: 30px;
}

header h1 {
    margin-bottom: 10px;
    font-size: 1.8rem;
}

/* Cards */
.card {
    background-color: rgb(200, 200, 200);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.card h2 {
    color: #00629B;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.card p {
    margin-bottom: 20px;
    color: #555;
}

/* Buttons */
button {
    background-color: #5b92e5;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #004d7a;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

button.secondary {
    background-color: transparent;
    border: 1px solid #5b92e5;
    color: #5b92e5;
}

button.secondary:hover {
    background-color: #f0f7ff;
}

.buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Progress bar */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ccc;
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
}

.progress-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    margin-bottom: 8px;
}

.progress-step.active .progress-circle {
    background-color: #5b92e5;
}

.progress-step.completed .progress-circle {
    background-color: #4CAF50;
}

.progress-step span {
    font-size: 0.85rem;
    color: #666;
    max-width: 100px;
    text-align: center;
}

.progress-step.active span,
.progress-step.completed span {
    color: #00629B;
    font-weight: 500;
}

/* Step content */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* Options container */
.options-container {
    margin: 20px 0;
}

.category-section {
    margin-bottom: 25px;
}

.category-section h3 {
    color: #00629B;
    margin-bottom: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

/* Checkbox styles */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-item {
    margin-bottom: 8px;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 5px;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.checkbox-item .tooltip {
    flex-shrink: 0;
}

/* Results container */
.results-container {
    margin-top: 20px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Methodology cards */
.methodology-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.methodology-header {
    background-color: #f5f5f5;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.methodology-header h3 {
    margin: 0;
    color: #5b92e5;
    font-size: 1.1rem;
}

.methodology-description-preview {
    padding: 15px;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.methodology-description-preview p {
    margin: 0;
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

.view-more-toggle-btn {
    width: 100%;
    background-color: #5b92e5;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.view-more-toggle-btn:hover {
    background-color: #004d7a;
}

.view-more-toggle-btn .arrow {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.methodology-details {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.methodology-details.active {
    padding: 20px;
    max-height: 1000px;
}

.methodology-details p {
    margin-bottom: 15px;
}

/* Criteria grid */
.criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.criteria-item {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 10px;
}

.criteria-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.criteria-value {
    color: #00629B;
}

/* Show more button */
.show-more-btn {
    background-color: transparent;
    color: #5b92e5;
    border: 1px solid #5b92e5;
    padding: 8px 15px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.show-more-btn:hover {
    background-color: #f0f7ff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #777;
    cursor: pointer;
}

.close-btn:hover {
    color: #333;
}

/* Help button */
#help-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: #5b92e5;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

#help-btn:hover {
    background-color: #004d7a;
}

/* Select all */

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.select-all-btn {
    background-color: #5d5d5d;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.select-all-btn:hover {
    background-color: #5486eb;
}

.select-all-btn.deselect {
    background-color: #ffebee;
    border-color: #f44336;
    color: #d32f2f;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #5b92e5;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: help;
    flex-shrink: 0;
}

.tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: normal;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Context summary */
.context-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.context-summary h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: white;
}

.context-summary p {
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
}

/* Decision trace */
.decision-trace {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.decision-trace h3 {
    margin: 0 0 15px 0;
    color: #00629B;
    font-size: 1.1rem;
}

.trace-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trace-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.trace-arrow {
    color: #5b92e5;
    font-size: 1.2rem;
    margin: 5px 0;
    padding-left: 10px;
}

.trace-step {
    background-color: white;
    padding: 12px 15px;
    border-radius: 6px;
    width: 100%;
    border-left: 3px solid #5b92e5;
}

.trace-step strong {
    color: #00629B;
}

.removed-count {
    color: #dc3545;
    font-weight: 600;
}

.remaining-count {
    color: #28a745;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Toggle All Buttons */
.toggle-all-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-all-btn {
    background-color: transparent;
    color: #1CABE2;
    border: 1px solid #1CABE2;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-all-btn:hover {
    background-color: #1CABE2;
    color: white;
}

/* Tier Accordion Sections */
.tier-accordion {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tier-accordion:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.accordion-header {
    padding: 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.accordion-header:hover {
    opacity: 0.9;
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.accordion-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    min-width: 20px;
}

.tier-header-text {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    flex: 1;
}

.method-count {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.3);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 20px;
}

.accordion-content.expanded {
    max-height: 10000px;
    padding: 0 20px 20px 20px;
}

.tier-description {
    margin: 0 0 20px 0;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.methods-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Best Fit Section - UNICEF Blue with Green Accent */
.best-fit-section {
    background: linear-gradient(135deg, #00A878 0%, #1CABE2 100%);
    border: 2px solid #00A878;
}

.best-fit-section .accordion-header {
    background-color: transparent;
    color: white;
}

.best-fit-section .tier-description {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

/* Good Alternatives Section - Amber */
.alternatives-section {
    background: linear-gradient(135deg, #F9A825 0%, #FBC02D 100%);
    border: 2px solid #F9A825;
}

.alternatives-section .accordion-header {
    background-color: transparent;
    color: white;
}

.alternatives-section .tier-description {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

/* Stretch Options Section - Orange */
.stretch-section {
    background: linear-gradient(135deg, #F57C00 0%, #FF9800 100%);
    border: 2px solid #F57C00;
}

.stretch-section .accordion-header {
    background-color: transparent;
    color: white;
}

.stretch-section .tier-description {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

/* Method badges */
.method-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.cost-badge {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.connectivity-badge {
    background-color: #f3e5f5;
    color: #6a1b9a;
    border: 1px solid #ce93d8;
}

.type-badge {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

/* Mismatch info */
.mismatch-info {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #856404;
}

.mismatch-info strong {
    color: #856404;
}

/* Method links container */
.method-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Method link */
.method-link {
    padding: 12px;
    background-color: #f0f7ff;
    border-left: 3px solid #5b92e5;
    border-radius: 4px;
}

.link-label {
    font-weight: 600;
    color: #00629B;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.method-link a {
    color: #5b92e5;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    word-break: break-all;
    line-height: 1.4;
}

.method-link a:hover {
    color: #004d7a;
    text-decoration: underline;
}

.external-icon {
    font-size: 0.85rem;
    margin-left: 3px;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .progress-bar {
        flex-wrap: wrap;
    }

    .progress-step {
        margin-bottom: 15px;
    }

    .checkbox-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .criteria-grid {
        grid-template-columns: 1fr;
    }

    .buttons {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .context-summary {
        padding: 15px;
    }

    .decision-trace {
        padding: 15px;
    }

    /* Accordion mobile styles */
    .accordion-header {
        padding: 15px;
    }

    .accordion-title {
        flex-wrap: wrap;
        gap: 10px;
    }

    .tier-header-text {
        font-size: 1.1rem;
    }

    .method-count {
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }

    .accordion-content {
        padding: 0 15px;
    }

    .accordion-content.expanded {
        padding: 0 15px 15px 15px;
    }

    .tier-description {
        padding: 12px;
        font-size: 0.9rem;
    }

    .toggle-all-container {
        flex-direction: column;
        gap: 8px;
    }

    .toggle-all-btn {
        width: 100%;
    }

    .method-badges {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge {
        width: 100%;
        justify-content: flex-start;
    }

    /* Make methodology cards more compact on mobile */
    .methodology-card {
        padding: 15px;
    }

    .methodology-header h3 {
        font-size: 1.1rem;
    }

    .methodology-description-preview {
        font-size: 0.9rem;
    }
}