/* ==========================================
   GATEKEEPER GLOBAL
========================================== */

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


/* ==========================================
   GATEKEEPER BRAND COLOURS
========================================== */

:root {

    --gk-navy: #071A3D;
    --gk-dark-blue: #0B2A63;
    --gk-blue: #087FE8;
    --gk-cyan: #00CFFF;

    --gk-background: #F4F7FB;
    --gk-card: #FFFFFF;

    --gk-text: #071A3D;
    --gk-muted: #52627A;

    --gk-border: #DDE6F2;

    --gk-success: #16A34A;

}


html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;

    background: var(--gk-background);

    color: var(--gk-text);
}


/* ==========================================
   MAIN APP
========================================== */

.app {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}


/* ==========================================
   HEADER
========================================== */

header,
.page-header {
    width: 100%;

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

    gap: 15px;
    margin-bottom: 25px;
}

header h1 {
    color: var(--gk-navy);
    font-size: 2rem;
}

.online {
    color: var(--gk-success);
    font-weight: bold;
    white-space: nowrap;
}


/* ==========================================
   HOME BUTTON
========================================== */

.home-button {
    display: inline-flex;

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

    gap: 8px;

    padding: 12px 18px;

    background: var(--gk-blue);
    color: white;

    border: none;
    border-radius: 10px;

    cursor: pointer;

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

    transition: 0.2s;
}

.home-button:hover {
    background: var(--gk-dark-blue);
}

.home-button:active {
    transform: scale(0.98);
}


/* ==========================================
   EVENT SELECT
========================================== */

.event-select {
    margin-bottom: 30px;
}

label {
    display: block;

    font-weight: bold;

    margin-bottom: 10px;

    color: var(--gk-navy);
}

select {
    width: 100%;

    padding: 15px;

    font-size: 1rem;

    border-radius: 10px;

    border: 2px solid var(--gk-border);

    background: white;

    color: var(--gk-navy);

    outline: none;

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

select:focus {
    border-color: var(--gk-blue);

    box-shadow:
        0 0 0 3px rgba(8, 127, 232, 0.15);
}


/* ==========================================
   HOME MENU
========================================== */

.menu {
    display: grid;
    gap: 20px;
}

.menu-card {
    width: 100%;

    border: 1px solid var(--gk-border);
    border-radius: 14px;

    background: white;

    padding: 28px;

    text-align: center;

    cursor: pointer;

    transition: 0.2s;

    box-shadow:
        0 4px 12px rgba(7, 26, 61, 0.08);
}

.menu-card:hover {
    transform: translateY(-3px);

    border-color: var(--gk-blue);

    box-shadow:
        0 8px 22px rgba(8, 127, 232, 0.14);
}

.icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.menu-card h2 {
    color: var(--gk-navy);
    margin-bottom: 10px;
}

.menu-card p {
    color: var(--gk-muted);
}


/* ==========================================
   FOOTER
========================================== */

footer {
    text-align: center;

    margin-top: 40px;

    color: var(--gk-muted);
}


/* ==========================================
   CHECK IN PAGE
========================================== */

.checkin-page {
    width: 100%;

    max-width: 1400px;

    margin: 0 auto;

    padding: 0;
}


/* ==========================================
   CHECK IN TITLE
========================================== */

.page-title {
    text-align: center;

    font-size: clamp(28px, 4vw, 46px);

    margin-bottom: 5px;

    color: var(--gk-navy);
}

.event-name {
    text-align: center;

    font-size: clamp(18px, 3vw, 34px);

    font-weight: bold;

    margin-bottom: 20px;

    color: var(--gk-blue);

    overflow-wrap: anywhere;
}


/* ==========================================
   CHECK IN GRID
========================================== */

.checkin-grid {
    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(300px, 1fr);

    gap: 20px;

    align-items: start;
}


/* ==========================================
   CAMERA CARD
========================================== */

.camera-card {
    width: 100%;

    background: white;

    border-radius: 16px;

    padding: 8px;

    box-shadow:
        0 4px 12px rgba(7, 26, 61, 0.08);

    overflow: hidden;
}


/* ==========================================
   CAMERA VIEW
========================================== */

/*
   IMPORTANT

   Keep this height fixed.

   Do NOT use aspect-ratio here.
   Do NOT use min-height: 500px.
*/

#camera {
    width: 100% !important;

    height: 260px !important;

    min-height: 260px !important;

    max-height: 260px !important;

    border-radius: 10px;

    overflow: hidden !important;

    background: #000;

    position: relative;
}


/* ==========================================
   HTML5-QRCODE OUTER CONTAINER
========================================== */

#camera > div {
    width: 100% !important;

    height: 260px !important;

    max-width: 100% !important;

    max-height: 260px !important;

    overflow: hidden !important;

    position: relative;
}


/* ==========================================
   HTML5-QRCODE VIDEO
========================================== */

#camera video {
    width: 100% !important;

    height: 260px !important;

    min-height: 260px !important;

    max-height: 260px !important;

    display: block !important;

    object-fit: cover !important;
}


/* ==========================================
   HTML5-QRCODE CANVAS
========================================== */

#camera canvas {
    width: 100% !important;

    max-width: 100% !important;

    max-height: 260px !important;
}


/* ==========================================
   SCAN STATUS
========================================== */

.scan-ready {
    width: 100%;

    margin-top: 8px;

    padding: 12px;

    text-align: center;

    font-size: clamp(16px, 2vw, 22px);

    font-weight: bold;

    border-radius: 10px;

    background: #E9F8ED;

    color: var(--gk-success);
}


/* ==========================================
   INFORMATION PANEL
========================================== */

.info-panel {
    width: 100%;

    display: flex;

    flex-direction: column;

    gap: 16px;
}


/* ==========================================
   TICKET / STATS CARDS
========================================== */

.ticket-card,
.stats-card {
    width: 100%;

    background: white;

    border-radius: 16px;

    padding: 20px;

    box-shadow:
        0 4px 12px rgba(7, 26, 61, 0.08);
}

.ticket-card h2 {
    margin: 0 0 15px;

    color: var(--gk-navy);
}


/* ==========================================
   TICKET ROWS
========================================== */

.ticket-row,
.stat-row {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    padding: 10px 0;

    border-bottom: 1px solid var(--gk-border);
}

.ticket-row:last-child,
.stat-row:last-child {
    border-bottom: none;
}

.ticket-row span,
.stat-row span {
    color: var(--gk-muted);
}

.ticket-row strong,
.stat-row strong {
    font-size: 1.05rem;

    text-align: right;

    overflow-wrap: anywhere;

    color: var(--gk-navy);
}


/* ==========================================
   TABLET
========================================== */

@media (max-width: 900px) {

    .app {
        padding: 15px;
    }

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

    /*
       Keep camera exactly the same height.
       We don't want the scanner geometry
       changing between devices.
    */

    #camera {
        height: 260px !important;

        min-height: 260px !important;

        max-height: 260px !important;
    }

    #camera > div {
        height: 260px !important;

        max-height: 260px !important;
    }

    #camera video {
        height: 260px !important;

        min-height: 260px !important;

        max-height: 260px !important;
    }
}


/* ==========================================
   PHONE
========================================== */

@media (max-width: 600px) {

    html,
    body {
        width: 100%;

        overflow-x: hidden;
    }

    .app {
        padding: 8px;
    }


    /* --------------------------------------
       HEADER
    -------------------------------------- */

    header,
    .page-header {
        margin-bottom: 10px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .online {
        font-size: 14px;
    }

    .home-button {
        padding: 9px 13px;

        font-size: 14px;
    }


    /* --------------------------------------
       CHECK IN
    -------------------------------------- */

    .checkin-page {
        width: 100%;

        padding: 0;
    }

    .page-title {
        font-size: 28px;

        margin-bottom: 2px;
    }

    .event-name {
        font-size: 18px;

        margin-bottom: 10px;
    }


    /* --------------------------------------
       CAMERA CARD
    -------------------------------------- */

    .camera-card {
        width: 100%;

        padding: 8px;

        border-radius: 10px;
    }


    /* --------------------------------------
       CAMERA
    -------------------------------------- */

    #camera {
        width: 100% !important;

        height: 260px !important;

        min-height: 260px !important;

        max-height: 260px !important;

        border-radius: 8px;
    }

    #camera > div {
        width: 100% !important;

        height: 260px !important;

        max-width: 100% !important;

        max-height: 260px !important;
    }

    #camera video {
        width: 100% !important;

        height: 260px !important;

        min-height: 260px !important;

        max-height: 260px !important;

        object-fit: cover !important;
    }

    #camera canvas {
        max-width: 100% !important;

        max-height: 260px !important;
    }


    /* --------------------------------------
       SCAN STATUS
    -------------------------------------- */

    .scan-ready {
        margin-top: 8px;

        padding: 9px;

        font-size: 16px;

        border-radius: 8px;
    }


    /* --------------------------------------
       INFORMATION
    -------------------------------------- */

    .info-panel {
        gap: 8px;
    }

    .ticket-card,
    .stats-card {
        padding: 10px;

        border-radius: 10px;
    }

    .ticket-card h2 {
        font-size: 18px;

        margin-bottom: 5px;
    }

    .ticket-row,
    .stat-row {
        padding: 6px 0;

        font-size: 14px;
    }

    .ticket-row strong,
    .stat-row strong {
        font-size: 15px;
    }
}


/* ==========================================
   SMALL PHONE
========================================== */

@media (max-width: 400px) {

    .app {
        padding: 5px;
    }

    .page-title {
        font-size: 25px;
    }

    .event-name {
        font-size: 16px;

        margin-bottom: 7px;
    }

    .camera-card {
        padding: 6px;
    }


    /* --------------------------------------
       CAMERA
    -------------------------------------- */

    #camera {
        width: 100% !important;

        height: 250px !important;

        min-height: 250px !important;

        max-height: 250px !important;
    }

    #camera > div {
        height: 250px !important;

        max-height: 250px !important;
    }

    #camera video {
        height: 250px !important;

        min-height: 250px !important;

        max-height: 250px !important;
    }

    #camera canvas {
        max-height: 250px !important;
    }


    /* --------------------------------------
       STATUS
    -------------------------------------- */

    .scan-ready {
        padding: 8px;

        font-size: 15px;
    }


    /* --------------------------------------
       INFORMATION
    -------------------------------------- */

    .ticket-card,
    .stats-card {
        padding: 8px;
    }

    .ticket-row,
    .stat-row {
        font-size: 13px;

        padding: 4px 0;
    }

    .ticket-row strong,
    .stat-row strong {
        font-size: 14px;
    }

}


/* =====================================
   STATS DASHBOARD
===================================== */

.stats-grid {
    display: grid;

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

    gap: 14px;

    width: 100%;
    max-width: 900px;

    margin: 20px auto;
}


/* =====================================
   STAT TILE
===================================== */

.stat-card {
    min-height: 150px;

    aspect-ratio: 1 / 0.85;

    padding: 18px;

    box-sizing: border-box;

    background: white;

    border-radius: 22px;

    box-shadow:
        0 4px 15px rgba(7, 26, 61, 0.08);

    display: flex;

    flex-direction: column;

    justify-content: space-between;
}


/* =====================================
   TILE TITLE
===================================== */

.stat-card h2 {
    margin: 0;

    font-size: 18px;

    font-weight: 500;

    color: var(--gk-muted);
}


/* =====================================
   BIG NUMBER
===================================== */

.stat-number {
    font-size: 42px;

    line-height: 1;

    font-weight: 700;

    color: var(--gk-navy);
}


/* =====================================
   DESCRIPTION
===================================== */

.stat-description {
    margin: 0;

    font-size: 13px;

    line-height: 1.3;

    color: var(--gk-muted);
}


/* =====================================
   GATEKEEPER HOME LOGO
===================================== */

.gatekeeper-main {
    padding-top: 10px;
}

.gatekeeper-brand {
    width: 100%;

    max-width: 900px;

    margin: 0 auto 5px auto;

    padding: 0;

    display: flex;

    justify-content: center;

    align-items: center;

    line-height: 0;
}

.gatekeeper-brand img {
    display: block;

    width: 100%;

    max-width: 850px;

    height: auto;

    margin: 0;

    padding: 0;
}


/* =====================================
   MOBILE
===================================== */

@media (max-width: 600px) {

    .stats-grid {

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

        gap: 10px;

        margin: 15px auto;

    }


    .stat-card {

        min-height: 100px;

        padding: 10px;

        border-radius: 18px;

    }


    .stat-card h2 {

        font-size: 16px;

    }


    .stat-number {

        font-size: 36px;

    }


    .stat-description {

        font-size: 12px;

    }


    .gatekeeper-brand {

        margin-bottom: 0;

    }

    .gatekeeper-brand img {

        width: 100%;

        max-width: 100%;

    }

    .gatekeeper-main {

        padding-top: 5px;

    }

}