/* Variables for consistent styling */
:root {
    --primary-color: #F97316;      /* Orange - buttons, accents, active states */
    --secondary-color: #EA580C;    /* Darker orange - hover states */
    --text-color: #1f2937;         /* Dark gray - body text */
    --light-text: #6b7280;         /* Medium gray - secondary text */
    --background: #FFFBF5;         /* Warm white - page background */
    --card-background: #ffffff;    /* White - cards, simulator area */
    --border-color: #FDBA74;       /* Light orange - borders, inactive elements */
    --disabled-color: #D1D5DB;     /* Gray - disabled/greyed out elements */
    --success-color: #059669;      /* Green - for positive indicators */
    --constraint-color: #DC2626;   /* Red - to highlight bottleneck */
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --max-width: 1200px;
    --spacing: 2rem;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* Typography */
h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

p {
    margin-bottom: 1rem;
}

/* Container for content width control */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Button styles */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.btn.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn.secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn:disabled {
    background: var(--disabled-color);
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Header */
header {
    background: var(--card-background);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #FED7AA 0%, #FDBA74 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.arrow-down {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 600;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Simulator Section */
.simulator-section {
    padding: 4rem 0;
}

.simulator-section h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.instructions {
    text-align: center;
    color: var(--light-text);
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
}

.simulator-container {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 2rem;
}

.stations {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.station {
    flex: 1;
    min-width: 150px;
    background: var(--background);
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.station.constraint {
    border-color: var(--constraint-color);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
    }
}

.station-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.capacity-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.station-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.station-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--card-background);
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.station-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.station-btn:disabled {
    border-color: var(--disabled-color);
    color: var(--disabled-color);
    cursor: not-allowed;
}

.improvement-count {
    font-size: 0.9rem;
    color: var(--light-text);
}

.simulator-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.budget-display,
.throughput-display {
    text-align: center;
}

.budget-display .label,
.throughput-display .label {
    display: block;
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-display .value,
.throughput-display .value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.throughput-display .value {
    color: var(--success-color);
    transition: var(--transition);
}

.throughput-change {
    animation: throughputFlash 0.6s ease;
}

@keyframes throughputFlash {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: var(--primary-color);
    }
    100% {
        transform: scale(1);
    }
}

/* Level Progression */
.level-progression {
    padding: 4rem 0;
    background: var(--card-background);
}

.level-progression h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.level-box {
    display: block;
    background: var(--background);
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.level-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.2);
}

.level-active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
}

.level-number {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.level-locked .level-number {
    background: var(--disabled-color);
}

.level-box h3 {
    margin-bottom: 0.5rem;
}

.level-box p {
    font-size: 0.9rem;
    color: var(--light-text);
}

.coming-soon {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.3rem 0.8rem;
    background: var(--disabled-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Insight Section */
.insight-section {
    padding: 4rem 0;
    text-align: center;
}

.insight-section h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.insight-section p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Offer Section */
.offer-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-align: center;
}

.offer-section h2 {
    color: white;
    margin-bottom: 1.5rem;
}

.offer-section p {
    max-width: 700px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
}

.offer-section .btn {
    background: white;
    color: var(--primary-color);
}

.offer-section .btn:hover {
    background: var(--background);
    transform: translateY(-3px);
}

/* Contact Section */
.contact-section {
    padding: 4rem 0;
    background: var(--card-background);
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-info {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-info .name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-info .company {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: var(--text-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--border-color);
}

footer a:hover {
    color: var(--primary-color);
}

/* Responsive adjustments for simulator */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .stations {
        flex-direction: column;
    }

    .station {
        min-width: 100%;
    }

    .simulator-controls {
        flex-direction: column;
    }

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

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.visible .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-body {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.modal-content .btn {
    display: block;
    width: 100%;
    text-align: center;
}

/* Insight Button Styles */
.insight-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.insight-btn.inactive {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--disabled-color);
}

.insight-btn.active {
    opacity: 1;
    cursor: pointer;
    animation: insightPulse 2s infinite;
}

.insight-btn.active:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

@keyframes insightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
    }
}

/* =============================================================================
   LEVEL 2: Floating Bottleneck Styles
   ============================================================================= */

.day-log {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
}

.day-log-entry {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.day-log-entry:last-child {
    border-bottom: none;
}

.day-log-entry .constraint-name {
    color: var(--constraint-color);
    font-weight: 600;
}

/* =============================================================================
   LEVEL 3: Branching Paths Styles
   ============================================================================= */

.stations-branching {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.branch-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.branch-row.shared {
    justify-content: center;
}

.branch-tracks {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.branch-track {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.branch-track.surgical {
    background: rgba(220, 38, 38, 0.05);
    border: 2px dashed rgba(220, 38, 38, 0.3);
}

.branch-track.medical {
    background: rgba(5, 150, 105, 0.05);
    border: 2px dashed rgba(5, 150, 105, 0.3);
}

.track-label {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.track-label.surgical {
    color: var(--constraint-color);
}

.track-label.medical {
    color: var(--success-color);
}

.throughput-dual {
    display: flex;
    gap: 2rem;
}

.throughput-display .value.surgical {
    color: var(--constraint-color);
}

.throughput-display .value.medical {
    color: var(--success-color);
}

/* Constraint highlighting for branching */
.station.constraint-surgical {
    border-color: var(--constraint-color);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.station.constraint-medical {
    border-color: var(--success-color);
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.3);
}

/* =============================================================================
   LEVEL 4: Shifting Constraint Styles
   ============================================================================= */

.constraint-history {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
    text-align: center;
}

.constraint-history .label {
    display: block;
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.history-value .arrow {
    color: var(--light-text);
    margin: 0 0.5rem;
}

/* Constraint shift animation */
@keyframes constraintShift {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(220, 38, 38, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    }
}

.station.constraint-shifted {
    animation: constraintShift 0.6s ease;
}

/* =============================================================================
   LEVEL 5: Request Demo Styles
   ============================================================================= */

.level-5-section {
    background: linear-gradient(135deg, #FED7AA 0%, #FDBA74 100%);
}

.level-5-section h2 {
    color: var(--text-color);
}

.level-5-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.level-5-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.level-5-content .btn {
    margin-top: 1rem;
}

/* =============================================================================
   MOBILE RESPONSIVE STYLES
   ============================================================================= */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    /* Level 3 Branching - stack tracks vertically */
    .branch-tracks {
        flex-direction: column;
    }

    .throughput-dual {
        flex-direction: column;
        gap: 1rem;
    }

    .branch-track {
        flex-direction: column;
    }

    .branch-row {
        flex-wrap: wrap;
    }

    /* Ensure touch-friendly button sizes */
    .station-btn {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
    }

    /* Stack simulator controls */
    .simulator-controls {
        gap: 1.5rem;
    }

    /* Day log adjustments */
    .day-log {
        max-height: 150px;
    }
}

/* Mobile devices (576px and below) */
@media (max-width: 576px) {
    /* Hero adjustments */
    .hero {
        padding: 2.5rem 0;
    }

    .arrow-down {
        font-size: 1.2rem;
    }

    /* Modal - full width with padding */
    .modal-content {
        width: 100%;
        margin: 0 0.5rem;
        padding: 1.5rem;
        max-height: 95vh;
        border-radius: var(--border-radius);
    }

    .modal-body {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .modal-body strong {
        font-size: 1rem;
    }

    /* Simulator section padding */
    .simulator-section {
        padding: 2.5rem 0;
    }

    .simulator-container {
        padding: 1rem;
    }

    /* Station cards */
    .station {
        padding: 1rem;
        min-width: 100%;
    }

    .station-name {
        font-size: 1rem;
    }

    .capacity-display {
        font-size: 1.75rem;
    }

    /* Touch-friendly buttons - min 44px for accessibility */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .insight-btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .station-btn {
        width: 44px;
        height: 44px;
    }

    /* Budget and throughput displays */
    .budget-display .value,
    .throughput-display .value {
        font-size: 2rem;
    }

    .budget-display .label,
    .throughput-display .label {
        font-size: 0.8rem;
    }

    /* Level 3 specific */
    .branch-track {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .track-label {
        font-size: 0.75rem;
    }

    /* Level 4 constraint history */
    .constraint-history {
        padding: 0.75rem;
    }

    .history-value {
        font-size: 0.95rem;
    }

    .history-value .arrow {
        margin: 0 0.25rem;
    }

    /* Level 5 CTA */
    .level-5-content p {
        font-size: 1rem;
    }

    /* Level navigation grid */
    .levels-grid {
        gap: 1rem;
    }

    .level-box {
        padding: 1.5rem;
    }

    .level-number {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    /* Offer section */
    .offer-section {
        padding: 2.5rem 0;
    }

    .offer-section p {
        font-size: 1rem;
    }
}

/* Extra small devices (320px) */
@media (max-width: 375px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .instructions {
        font-size: 0.95rem;
    }

    /* Compact stations further */
    .capacity-display {
        font-size: 1.5rem;
        margin: 0.75rem 0;
    }

    .station-controls {
        gap: 0.75rem;
    }

    /* Compact throughput displays */
    .budget-display .value,
    .throughput-display .value {
        font-size: 1.75rem;
    }

    /* Modal adjustments for very small screens */
    .modal-content {
        padding: 1rem;
    }

    .modal-content h2 {
        font-size: 1.25rem;
    }

    /* Level 3 track labels more compact */
    .throughput-dual {
        gap: 0.75rem;
    }
}
