:root {
    --orange: #f58220;
    --orange-light: #ff9b45;
    --black: #080808;
    --black-2: #101010;
    --black-3: #171717;
    --black-4: #202020;
    --white: #ffffff;
    --gray: #a5a5a5;
    --gray-dark: #666;
    --border: rgba(255, 255, 255, 0.08);
}


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

* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;

    min-height: 100vh;

    color: var(--white);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background:
        radial-gradient(
            circle at 85% 5%,
            rgba(245, 130, 32, 0.20),
            transparent 27%
        ),
        radial-gradient(
            circle at 5% 35%,
            rgba(245, 130, 32, 0.07),
            transparent 22%
        ),
        linear-gradient(
            135deg,
            #050505 0%,
            #0c0c0c 45%,
            #111111 100%
        );

    background-attachment: fixed;
}


/* subtle background texture */

body::before {
    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    opacity: 0.025;

    background-image:
        radial-gradient(
            rgba(255, 255, 255, 0.8) 1px,
            transparent 1px
        );

    background-size: 5px 5px;

    z-index: -1;
}


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

.container {
    width: min(1500px, 100%);

    margin: 0 auto;

    padding: 30px 38px 70px;
}


/* =========================================================
   HERO
========================================================= */

.header {
    position: relative;

    display: flex;

    justify-content: space-between;

    align-items: center;

    min-height: 190px;

    margin-bottom: 25px;

    padding: 40px 45px;

    overflow: hidden;

    border-radius: 18px;

    background:
        linear-gradient(
            110deg,
            rgba(15, 15, 15, 0.98),
            rgba(23, 23, 23, 0.94)
        );

    border: 1px solid var(--border);

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.35);
}


/* orange diagonal decoration */

.header::after {
    content: "";

    position: absolute;

    width: 420px;

    height: 420px;

    right: -170px;

    top: -170px;

    border-radius: 50%;

    border: 55px solid
        rgba(245, 130, 32, 0.10);
}


/* small orange accent */

.header::before {
    content: "";

    position: absolute;

    left: 0;

    top: 0;

    width: 7px;

    height: 100%;

    background: var(--orange);
}


.header h1 {
    position: relative;

    z-index: 2;

    margin: 0;

    font-size: clamp(32px, 4vw, 52px);

    font-weight: 900;

    letter-spacing: -2px;

    line-height: 1;
}


.header h1 span {
    color: var(--orange);
}


.header p {
    position: relative;

    z-index: 2;

    margin: 12px 0 0;

    color: var(--gray);

    font-size: 13px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 3px;
}


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

.refresh-button {
    position: relative;

    z-index: 3;

    border: 1px solid
        rgba(245, 130, 32, 0.7);

    background:
        rgba(245, 130, 32, 0.10);

    color: var(--orange);

    padding: 13px 21px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 13px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 1px;

    transition:
        all 0.2s ease;
}


.refresh-button:hover {
    background: var(--orange);

    color: var(--black);

    transform: translateY(-2px);

    box-shadow:
        0 10px 30px
        rgba(245, 130, 32, 0.25);
}


/* =========================================================
   METRICS
========================================================= */

.metrics {
    display: grid;

    grid-template-columns:
        1.35fr
        1fr
        1fr
        1fr;

    gap: 16px;

    margin-bottom: 20px;
}


.metric-card {
    position: relative;

    min-height: 135px;

    padding: 24px 25px;

    overflow: hidden;

    border-radius: 14px;

    border: 1px solid var(--border);

    background:
        linear-gradient(
            145deg,
            rgba(28, 28, 28, 0.95),
            rgba(14, 14, 14, 0.95)
        );

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.20);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}


.metric-card:hover {
    transform: translateY(-4px);

    border-color:
        rgba(245, 130, 32, 0.35);
}


/* big number glow */

.metric-card::after {
    content: "";

    position: absolute;

    width: 100px;

    height: 100px;

    right: -45px;

    bottom: -50px;

    border-radius: 50%;

    background:
        rgba(245, 130, 32, 0.12);

    filter: blur(15px);
}


.metric-card:first-child {
    background:
        linear-gradient(
            135deg,
            #f58220 0%,
            #bd570b 100%
        );

    border: none;

    color: var(--black);
}


.metric-card:first-child .metric-title {
    color: rgba(0, 0, 0, 0.65);
}


.metric-card:first-child .metric-value {
    color: #000;
}


.metric-title {
    position: relative;

    z-index: 2;

    margin-bottom: 13px;

    color: var(--gray);

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 1.7px;
}


.metric-value {
    position: relative;

    z-index: 2;

    font-size: 42px;

    line-height: 1;

    font-weight: 900;

    letter-spacing: -2px;
}


/* =========================================================
   CONTENT GRID
========================================================= */

.charts {
    display: grid;

    grid-template-columns:
        0.85fr
        1.15fr;

    gap: 20px;

    margin-bottom: 20px;
}


/* =========================================================
   CARDS
========================================================= */

.card {
    position: relative;

    background:
        linear-gradient(
            145deg,
            rgba(25, 25, 25, 0.96),
            rgba(13, 13, 13, 0.96)
        );

    border:
        1px solid var(--border);

    border-radius: 14px;

    padding: 25px;

    margin-bottom: 20px;

    overflow: hidden;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.22);
}


.card::before {
    content: "";

    position: absolute;

    top: 0;

    left: 0;

    width: 45px;

    height: 2px;

    background: var(--orange);
}


.card h2 {
    margin: 0 0 18px;

    font-size: 16px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.8px;
}


/* =========================================================
   CHARTS
========================================================= */

.chart {
    height: 390px;
}


.large-chart {
    height: 470px;
}


/* =========================================================
   CHURCH SECTION
========================================================= */

.table-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-bottom: 20px;
}


#church-search {
    width: 300px;

    padding: 12px 15px;

    color: white;

    background: #0d0d0d;

    border:
        1px solid var(--border);

    border-radius: 8px;

    outline: none;

    font-size: 14px;

    transition: 0.2s ease;
}


#church-search::placeholder {
    color: #666;
}


#church-search:focus {
    border-color: var(--orange);

    box-shadow:
        0 0 0 3px
        rgba(245, 130, 32, 0.10);
}


/* =========================================================
   TABLE
========================================================= */

table {
    width: 100%;

    border-collapse: separate;

    border-spacing: 0;
}


thead {
    background: #0d0d0d;
}


th {
    padding: 14px 15px;

    text-align: left;

    color: #777;

    font-size: 10px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 1.3px;

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


td {
    padding: 14px 15px;

    color: #ddd;

    font-size: 14px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.055);
}


tbody tr {
    transition:
        background 0.15s ease;
}


tbody tr:hover {
    background:
        rgba(245, 130, 32, 0.055);
}


tbody td:first-child {
    color: white;

    font-weight: 650;
}


tbody td:last-child {
    color: var(--orange);

    font-weight: 900;
}


/* =========================================================
   DOWNLOADS
========================================================= */

.downloads {
    display: flex;

    justify-content: flex-end;

    gap: 12px;

    margin-top: 5px;

    padding-top: 5px;
}


.download-button {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 12px 18px;

    border-radius: 7px;

    background: var(--orange);

    color: #080808;

    text-decoration: none;

    font-size: 11px;

    font-weight: 900;

    text-transform: uppercase;

    letter-spacing: 0.7px;

    transition: 0.2s ease;
}


.download-button:hover {
    background: var(--orange-light);

    transform: translateY(-2px);

    box-shadow:
        0 10px 25px
        rgba(245, 130, 32, 0.20);
}


/* =========================================================
   PLOTLY
========================================================= */

.js-plotly-plot {
    width: 100%;
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 8px;

    height: 8px;
}


::-webkit-scrollbar-track {
    background: #080808;
}


::-webkit-scrollbar-thumb {
    background: #333;

    border-radius: 10px;
}


::-webkit-scrollbar-thumb:hover {
    background: var(--orange);
}


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

@media (max-width: 1050px) {

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

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


@media (max-width: 650px) {

    .container {
        padding: 18px 15px 40px;
    }


    .header {
        min-height: 160px;

        padding: 30px 28px;

        align-items: flex-start;

        flex-direction: column;

        gap: 25px;
    }


    .header h1 {
        font-size: 34px;
    }


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


    .metric-card {
        min-height: 115px;
    }


    .metric-value {
        font-size: 36px;
    }


    .table-header {
        flex-direction: column;

        align-items: stretch;
    }


    #church-search {
        width: 100%;
    }


    .downloads {
        flex-direction: column;
    }


    .download-button {
        justify-content: center;
    }


    .chart {
        height: 320px;
    }


    .large-chart {
        height: 400px;
    }

}

/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at 50% 40%,
            rgba(245, 130, 32, 0.12),
            transparent 35%
        );
}


.login-card {
    position: relative;

    width: 100%;

    max-width: 430px;

    padding: 45px 40px;

    text-align: center;

    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            rgba(27, 27, 27, 0.98),
            rgba(12, 12, 12, 0.98)
        );

    border:
        1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.55);
}


.login-card::before {
    content: "";

    position: absolute;

    top: 0;

    left: 0;

    right: 0;

    height: 4px;

    border-radius:
        16px 16px 0 0;

    background: var(--orange);
}


.login-logo {
    font-size: 32px;

    font-weight: 900;

    letter-spacing: -1.5px;
}


.login-logo span {
    color: var(--orange);
}


.login-subtitle {
    margin-top: 8px;

    color: var(--gray);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 2.5px;
}


.login-divider {
    width: 45px;

    height: 2px;

    margin: 28px auto;

    background: var(--orange);
}


.login-card h2 {
    margin: 0;

    font-size: 22px;

    font-weight: 800;
}


.login-card p {
    margin: 8px 0 25px;

    color: var(--gray);

    font-size: 14px;
}


.login-card form {
    display: flex;

    flex-direction: column;

    gap: 12px;
}


.login-card input {
    width: 100%;

    padding: 15px;

    border-radius: 7px;

    border:
        1px solid rgba(255, 255, 255, 0.10);

    outline: none;

    background: #080808;

    color: white;

    text-align: center;

    font-size: 15px;

    letter-spacing: 2px;

    transition: 0.2s ease;
}


.login-card input::placeholder {
    color: #555;

    letter-spacing: 0;
}


.login-card input:focus {
    border-color: var(--orange);

    box-shadow:
        0 0 0 3px
        rgba(245, 130, 32, 0.10);
}


.login-card button {
    padding: 15px;

    border: none;

    border-radius: 7px;

    background: var(--orange);

    color: #080808;

    cursor: pointer;

    font-size: 12px;

    font-weight: 900;

    letter-spacing: 1px;

    transition: 0.2s ease;
}


.login-card button:hover {
    background: var(--orange-light);

    transform: translateY(-2px);

    box-shadow:
        0 10px 30px
        rgba(245, 130, 32, 0.25);
}


.login-error {
    margin-top: 18px;

    padding: 10px;

    border-radius: 6px;

    background:
        rgba(220, 50, 50, 0.10);

    color: #ff7070;

    font-size: 13px;
}