/* ===========================
   Global
=========================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Poppins',sans-serif;
}

body{
    background:#f5f5f5;
    color:#111;
}

/* ===========================
   Navigation
=========================== */

nav{
    background:#111;
    color:#fff;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 50px;
}

.logo{
    font-size:32px;
    font-weight:700;
}

nav ul{
    display:flex;
    list-style:none;
    gap:35px;
}

nav ul li a{
    color:#fff;
    text-decoration:none;
    font-size:18px;
    transition:.3s;
}

nav ul li a:hover{
    color:#d3d3d3;
}

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

header{
    text-align:center;
    padding:50px 20px;
}

header h1{
    font-size:56px;
    margin-bottom:15px;
}

header p{
    font-size:22px;
    color:#555;
    margin-bottom:20px;
}

.back-btn{
    display:inline-block;
    padding:14px 30px;
    background:#111;
    color:#fff;
    text-decoration:none;
    border-radius:12px;
    transition:.3s;
}

.back-btn:hover{
    background:#333;
}

/* ===========================
   Layout
=========================== */

.map-container{
    width:92%;
    margin:40px auto;
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:35px;
}

/* ===========================
   Stadium Section
=========================== */

.stadium-image-container{
    background:#fff;
    padding:30px;
    border-radius:20px;
    box-shadow:0 8px 20px rgba(0,0,0,.12);
}

.stadium-image-container h2{
    text-align:center;
    font-size:36px;
    margin-bottom:25px;
}

.stadium-image{
    width:100%;
    border-radius:15px;
    margin-bottom:35px;
    box-shadow:0 6px 15px rgba(0,0,0,.15);
}

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

.location-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
}

.location-card{
    background:#fff;
    border:2px solid #eee;
    border-radius:16px;
    padding:20px;
    text-align:center;
    cursor:pointer;
    transition:.3s;
}

.location-card:hover{
    transform:translateY(-8px);
    border-color:#111;
    box-shadow:0 12px 25px rgba(0,0,0,.15);
}

.location-card img{
    width:85px;
    height:85px;
    object-fit:cover;
    border-radius:12px;
    margin-bottom:15px;
}

.location-card h3{
    font-size:22px;
}

/* ===========================
   Info Box
=========================== */

#infoBox{
    background:#fff;
    padding:30px;
    border-radius:20px;
    box-shadow:0 8px 20px rgba(0,0,0,.12);
    position:sticky;
    top:100px;
    text-align:center;
    min-height:550px;
}

.info-image{
    width:100%;
    height:230px;
    object-fit:cover;
    border-radius:15px;
    margin-bottom:20px;
    box-shadow:0 6px 15px rgba(0,0,0,.15);
}

#infoBox h2{
    font-size:34px;
    margin-bottom:15px;
}

#infoBox p{
    font-size:20px;
    color:#444;
    line-height:1.8;
}

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

footer{
    background:#111;
    color:#fff;
    text-align:center;
    padding:25px;
    font-size:18px;
    margin-top:50px;
}

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

@media(max-width:1000px){

    nav{
        flex-direction:column;
        gap:20px;
    }

    nav ul{
        flex-wrap:wrap;
        justify-content:center;
    }

    .map-container{
        grid-template-columns:1fr;
    }

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

    #infoBox{
        position:static;
        min-height:auto;
    }

    header h1{
        font-size:42px;
    }

    .stadium-image-container h2{
        font-size:30px;
    }

}
/* Accessibility */

.skip-link{

position:absolute;
left:-9999px;
top:auto;
background:#000;
color:#fff;
padding:12px 18px;
text-decoration:none;
border-radius:8px;
z-index:1000;

}

.skip-link:focus{

left:20px;
top:20px;

}

.location-card:focus{

outline:3px solid #FFD54F;
outline-offset:4px;

}

nav a:focus{

outline:3px solid #FFD54F;
outline-offset:3px;

}

.crowd-dashboard{

    background:#fff;
    width:92%;
    margin:35px auto;

    padding:30px;

    border-radius:20px;

    box-shadow:0 8px 20px rgba(0,0,0,.12);

}

.section-heading{

    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;

    margin-bottom:30px;

}

.section-label{

    color:#777;

    font-size:14px;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:1px;

}

.live-update{

    display:flex;
    align-items:center;
    gap:10px;

    background:#f3f3f3;

    padding:10px 18px;

    border-radius:50px;

    font-size:15px;
    font-weight:600;

}

.live-dot{

    width:12px;
    height:12px;

    background:#00c853;

    border-radius:50%;

    animation:pulse 1.2s infinite;

}

/* ========================================= */

.crowd-summary-grid{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:20px;

}

.summary-card{

    background:#fafafa;

    border:2px solid #ececec;

    border-radius:16px;

    padding:25px;

    display:flex;
    align-items:center;

    gap:18px;

    transition:.3s;

}

.summary-card:hover{

    transform:translateY(-6px);

    border-color:#111;

    box-shadow:0 10px 24px rgba(0,0,0,.12);

}

.summary-icon{

    width:58px;
    height:58px;

    border-radius:50%;

    background:#111;

    color:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:26px;

}

.summary-card p{

    color:#666;

    font-size:15px;

}

.summary-card strong{

    display:block;

    margin-top:5px;

    font-size:24px;

}

/* ========================================= */

.crowd-alert{

    width:92%;
    margin:25px auto;

    background:#fff4db;

    border-left:8px solid #ff9800;

    border-radius:18px;

    padding:22px;

    display:flex;
    align-items:flex-start;

    gap:20px;

    box-shadow:0 8px 18px rgba(0,0,0,.10);

}

.alert-icon{

    font-size:38px;

}

.crowd-alert h2{

    margin-bottom:8px;

    font-size:24px;

}

.crowd-alert p{

    font-size:18px;

    color:#444;

    line-height:1.7;

}

/* ========================================= */

.map-title-row{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:25px;

}

.heatmap-legend{

    display:flex;

    gap:18px;

    flex-wrap:wrap;

}

.heatmap-legend span{

    display:flex;

    align-items:center;

    gap:8px;

    font-size:14px;

    font-weight:600;

}

.legend-dot{

    width:15px;

    height:15px;

    border-radius:50%;

    display:inline-block;

}

.crowd-low{

    background:#2ecc71;

}

.crowd-moderate{

    background:#f1c40f;

}

.crowd-high{

    background:#ff9800;

}

.crowd-critical{

    background:#e53935;

}

/* ========================================= */

@keyframes pulse{

    0%{

        transform:scale(1);
        opacity:1;

    }

    50%{

        transform:scale(1.35);
        opacity:.45;

    }

    100%{

        transform:scale(1);
        opacity:1;

    }

}

/* ========================================= */

@media(max-width:1100px){

    .crowd-summary-grid{

        grid-template-columns:repeat(2,1fr);

    }

}

@media(max-width:700px){

    .crowd-summary-grid{

        grid-template-columns:1fr;

    }

    .section-heading{

        flex-direction:column;
        align-items:flex-start;

    }

    .map-title-row{

        flex-direction:column;
        align-items:flex-start;
        gap:20px;

    }

}


/* Stadium Heatmap Area */

.stadium-heatmap {
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
    border-radius: 18px;
}

.stadium-heatmap .stadium-image {
    display: block;
    width: 100%;
    margin-bottom: 0;
    border-radius: 18px;
}

/* Heatmap Gate Markers */

.heatmap-marker {
    position: absolute;
    z-index: 5;

    min-width: 92px;
    padding: 10px 13px;

    border: 3px solid #fff;
    border-radius: 14px;

    color: #111;
    font-family: "Poppins", sans-serif;
    text-align: center;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.28),
        0 0 0 6px rgba(255, 255, 255, 0.2);

    transform: translate(-50%, -50%);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.heatmap-marker:hover,
.heatmap-marker:focus-visible {
    transform: translate(-50%, -50%) scale(1.08);

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.35),
        0 0 0 8px rgba(255, 255, 255, 0.3);
}

.heatmap-marker:focus-visible {
    outline: 4px solid #fff;
    outline-offset: 4px;
}

.heatmap-marker span,
.heatmap-marker strong {
    display: block;
}

.heatmap-marker span {
    font-size: 12px;
    font-weight: 600;
}

.heatmap-marker strong {
    margin-top: 2px;
    font-size: 19px;
}

/* Adjust these positions according to your stadium image */

.gate-one-marker {
    top: 72%;
    left: 18%;
}

.gate-two-marker {
    top: 22%;
    left: 49%;
}

.gate-three-marker {
    top: 50%;
    left: 81%;
}

.gate-four-marker {
    top: 78%;
    left: 56%;
}

/* Dynamic Heatmap Colours */

.heatmap-marker.status-low {
    background: #2ecc71;
}

.heatmap-marker.status-moderate {
    background: #f1c40f;
}

.heatmap-marker.status-high {
    background: #ff9800;
}

.heatmap-marker.status-critical {
    background: #e53935;
    color: #fff;
    animation: criticalPulse 1.3s infinite;
}

/* ===================================================
   Gate Crowd Cards
=================================================== */

.gate-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.gate-crowd-card {
    padding: 22px;

    background: #fafafa;

    border: 2px solid #e8e8e8;
    border-radius: 16px;

    text-align: left;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.gate-crowd-card:hover {
    transform: translateY(-5px);
    border-color: #111;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.gate-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.gate-card-top > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.gate-name {
    color: #111;
    font-size: 20px;
    font-weight: 700;
}

.gate-card-top strong {
    color: #111;
    font-size: 29px;
    line-height: 1;
}

.crowd-status {
    width: fit-content;
    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.gate-crowd-card.status-low .crowd-status {
    background: #dff7e8;
    color: #15733b;
}

.gate-crowd-card.status-moderate .crowd-status {
    background: #fff6c9;
    color: #7a6200;
}

.gate-crowd-card.status-high .crowd-status {
    background: #ffead0;
    color: #a34f00;
}

.gate-crowd-card.status-critical .crowd-status {
    background: #ffe0e0;
    color: #ad1616;
}

/* Progress Bars */

.crowd-progress {
    width: 100%;
    height: 13px;

    margin: 20px 0 14px;

    overflow: hidden;

    background: #e7e7e7;

    border-radius: 999px;
}

.crowd-progress-fill {
    height: 100%;
    min-width: 4%;

    background: #111;

    border-radius: inherit;

    transition:
        width 0.8s ease,
        background 0.3s ease;
}

.gate-crowd-card.status-low .crowd-progress-fill {
    background: #2ecc71;
}

.gate-crowd-card.status-moderate .crowd-progress-fill {
    background: #f1c40f;
}

.gate-crowd-card.status-high .crowd-progress-fill {
    background: #ff9800;
}

.gate-crowd-card.status-critical .crowd-progress-fill {
    background: #e53935;
}

.gate-crowd-card > p {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}

/* Highlight Recommended Gate */

.gate-crowd-card.recommended-gate {
    border-color: #111;
    box-shadow:
        0 0 0 3px rgba(17, 17, 17, 0.08),
        0 12px 25px rgba(0, 0, 0, 0.12);
}

.gate-crowd-card.recommended-gate::after {
    content: "Recommended";
    display: inline-block;

    margin-top: 14px;
    padding: 6px 11px;

    background: #111;
    color: #fff;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ===================================================
   AI Prediction Card
=================================================== */

.ai-prediction-card {
    display: flex;
    align-items: flex-start;
    gap: 22px;

    margin-bottom: 36px;
    padding: 26px;

    background: #111;
    color: #fff;

    border-radius: 18px;

    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);

    text-align: left;
}

.prediction-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    min-width: 64px;
    height: 64px;

    background: #fff;
    color: #111;

    border-radius: 50%;

    font-size: 30px;
}

.prediction-content {
    flex: 1;
}

.ai-prediction-card .section-label {
    color: #bdbdbd;
}

.prediction-content h2 {
    margin: 5px 0 10px;

    color: #fff;

    font-size: 26px;
    text-align: left;
}

#predictionMessage {
    color: #e0e0e0;

    font-size: 16px;
    line-height: 1.7;
}

.confidence-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 20px;
    padding-top: 17px;

    border-top: 1px solid #3f3f3f;
}

.confidence-row span {
    color: #c9c9c9;
    font-size: 14px;
}

.confidence-row strong {
    font-size: 23px;
}

/* ===================================================
   Alert Variants
=================================================== */

.crowd-alert.alert-safe {
    background: #e5f8ec;
    border-left-color: #2ecc71;
}

.crowd-alert.alert-warning {
    background: #fff4db;
    border-left-color: #ff9800;
}

.crowd-alert.alert-critical {
    background: #ffe4e4;
    border-left-color: #e53935;
}

.crowd-alert.alert-critical .alert-icon {
    animation: shake 0.8s ease-in-out infinite alternate;
}

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

@keyframes criticalPulse {
    0% {
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.28),
            0 0 0 5px rgba(229, 57, 53, 0.25);
    }

    50% {
        box-shadow:
            0 12px 28px rgba(0, 0, 0, 0.35),
            0 0 0 14px rgba(229, 57, 53, 0.08);
    }

    100% {
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.28),
            0 0 0 5px rgba(229, 57, 53, 0.25);
    }
}

@keyframes shake {
    from {
        transform: rotate(-5deg);
    }

    to {
        transform: rotate(5deg);
    }
}

/* ===================================================
   Responsive Heatmap
=================================================== */

@media (max-width: 900px) {
    .gate-heatmap-grid {
        grid-template-columns: 1fr;
    }

    .heatmap-marker {
        min-width: 78px;
        padding: 8px 10px;
    }

    .heatmap-marker span {
        font-size: 10px;
    }

    .heatmap-marker strong {
        font-size: 16px;
    }
}

@media (max-width: 650px) {
    .stadium-image-container {
        padding: 20px;
    }

    .heatmap-legend {
        gap: 10px 14px;
    }

    .heatmap-legend span {
        font-size: 12px;
    }

    .heatmap-marker {
        min-width: 64px;
        padding: 6px 7px;
        border-width: 2px;
        border-radius: 10px;
    }

    .heatmap-marker span {
        font-size: 8px;
    }

    .heatmap-marker strong {
        font-size: 13px;
    }

    .gate-one-marker {
        left: 19%;
    }

    .gate-three-marker {
        left: 79%;
    }

    .gate-crowd-card {
        padding: 18px;
    }

    .gate-name {
        font-size: 17px;
    }

    .gate-card-top strong {
        font-size: 24px;
    }

    .ai-prediction-card {
        flex-direction: column;
        padding: 22px 19px;
    }

    .prediction-icon {
        width: 55px;
        min-width: 55px;
        height: 55px;
        font-size: 26px;
    }

    .prediction-content h2 {
        font-size: 22px;
    }

    #predictionMessage {
        font-size: 14px;
    }

    .confidence-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 430px) {
    .heatmap-marker {
        min-width: 55px;
        padding: 5px;
    }

    .heatmap-marker span {
        display: none;
    }

    .heatmap-marker strong {
        margin: 0;
        font-size: 12px;
    }
}

/* Reduced Motion */

@media (prefers-reduced-motion: reduce) {
    .heatmap-marker,
    .crowd-progress-fill,
    .gate-crowd-card,
    .ai-prediction-card,
    .crowd-alert {
        animation: none !important;
        transition: none !important;
    }
}
/* ===================================================
   AI Crowd Route Optimizer
=================================================== */

.route-optimizer {
    margin: 35px 0;
    padding: 30px;

    background: #f9f9f9;

    border: 2px solid #e9e9e9;
    border-radius: 20px;

    text-align: left;

    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.route-optimizer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 25px;

    margin-bottom: 28px;
}

.route-optimizer-header h2 {
    margin: 5px 0 8px;

    font-size: 30px;
    text-align: left;
}

.route-optimizer-header p {
    color: #555;
    font-size: 15px;
    line-height: 1.7;
}

.optimizer-badge {
    flex-shrink: 0;

    padding: 8px 14px;

    background: #111;
    color: #fff;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Form */

.route-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.route-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.route-field label {
    color: #222;
    font-size: 14px;
    font-weight: 700;
}

.route-field select {
    width: 100%;
    min-height: 50px;

    padding: 0 14px;

    background: #fff;
    color: #111;

    border: 2px solid #dedede;
    border-radius: 12px;

    font-family: "Poppins", sans-serif;
    font-size: 14px;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.route-field select:hover {
    border-color: #999;
}

.route-field select:focus {
    border-color: #111;
    outline: none;
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.09);
}

/* Checkbox */

.accessibility-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin: 22px 0;

    color: #333;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.accessibility-option input {
    width: 18px;
    height: 18px;

    accent-color: #111;

    cursor: pointer;
}

/* Button */

.optimize-route-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 52px;
    padding: 13px 24px;

    background: #111;
    color: #fff;

    border: 2px solid #111;
    border-radius: 12px;

    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.optimize-route-btn:hover {
    background: #fff;
    color: #111;

    transform: translateY(-2px);

    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.14);
}

.optimize-route-btn:focus-visible {
    outline: 3px solid #ffd54f;
    outline-offset: 4px;
}

.optimize-route-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

/* Result Box */

.route-result {
    margin-top: 30px;
    padding: 26px;

    background: #fff;

    border: 2px solid #dedede;
    border-radius: 18px;

    animation: routeResultEnter 0.4s ease;
}

.route-result-hidden {
    display: none;
}

.route-result-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 24px;
}

.route-result-heading h3 {
    margin-top: 4px;
    font-size: 25px;
}

#routeStatusBadge {
    flex-shrink: 0;

    padding: 7px 12px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

#routeStatusBadge.status-low {
    background: #dff7e8;
    color: #15733b;
}

#routeStatusBadge.status-moderate {
    background: #fff6c9;
    color: #7a6200;
}

#routeStatusBadge.status-high {
    background: #ffead0;
    color: #a34f00;
}

#routeStatusBadge.status-critical {
    background: #ffe0e0;
    color: #ad1616;
}

/* Route Steps */

.route-steps {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 25px;
    padding-bottom: 24px;

    overflow-x: auto;

    border-bottom: 1px solid #e4e4e4;
}

.route-step {
    display: flex;
    align-items: center;
    gap: 10px;

    flex-shrink: 0;
}

.route-step-location {
    padding: 10px 14px;

    background: #111;
    color: #fff;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;
}

.route-step-arrow {
    color: #777;
    font-size: 22px;
    font-weight: 700;
}

/* Metrics */

.route-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.route-metrics div {
    padding: 16px;

    background: #f7f7f7;

    border: 1px solid #e7e7e7;
    border-radius: 13px;
}

.route-metrics span {
    display: block;

    color: #666;

    font-size: 12px;
    font-weight: 600;
}

.route-metrics strong {
    display: block;

    margin-top: 6px;

    color: #111;
    font-size: 20px;
}

.route-explanation {
    margin-top: 22px;
    padding: 17px 18px;

    background: #f4f4f4;

    border-left: 5px solid #111;
    border-radius: 10px;

    color: #444;

    font-size: 14px;
    line-height: 1.75;
}

/* Error State */

.route-error {
    margin-top: 20px;
    padding: 15px 18px;

    background: #ffe4e4;
    color: #9b1515;

    border-left: 5px solid #e53935;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 600;
}

/* Animation */

@keyframes routeResultEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */

@media (max-width: 900px) {
    .route-form-grid {
        grid-template-columns: 1fr;
    }

    .route-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .route-optimizer {
        padding: 22px 18px;
    }

    .route-optimizer-header {
        flex-direction: column;
    }

    .route-optimizer-header h2 {
        font-size: 24px;
    }

    .route-result-heading {
        flex-direction: column;
    }

    .route-metrics {
        grid-template-columns: 1fr;
    }

    .optimize-route-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .route-result,
    .optimize-route-btn,
    .route-field select {
        animation: none;
        transition: none;
    }
}