
:root {
    --sp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body, button, input, select, textarea, table, th, td {
    font-family: var(--sp-font);
    font-size: 14px;
    line-height: 1.4;
}

.tableFixHead    { overflow: auto; height: 500px; }
.tableFixHead th { position: sticky; top: 0; }

table {
    table-layout: auto;
    width: 100%;
    border-collapse: collapse;
    border: 1px solid black;
    z-index: 0;
    position: relative;
}

th {
    border-collapse: collapse;
    border: 1px solid black;
    padding: 5px;
    background-color: silver;
}

td {
    border-collapse: collapse;
    border: 1px solid black;
    padding: 5px;
}

.errorCell {
    background-color: red;
}

.highlightedRow {
    background-color: lightblue;
}

.standardText {
    font-family: var(--sp-font);
    font-size: 14px;
}

.boldText {
    font-family: var(--sp-font);
    font-size: 14px;
    font-weight: bold;
}

/* Home page feature grid */

.homeSectionContainer {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.homeInfoSection {
    width: 100%;
    background-color: #e5e7eb;
    padding: 40px 20px;
    box-sizing: border-box;
}

.homeFeatures {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 24px;
    align-items: center;
}

.homeFeatureCard {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.homeFeatureCardContent {
    width: 100%;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 16px;
    box-sizing: border-box;
}

.homeShotTimerCard {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.homeShotTimerContent {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 240px;
    min-width: 0;
}

.homeShotTimerText {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.homeShotTimerTitleRow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.homeShotTimerBadge {
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.homeShotTimerLink {
    display: inline-flex;
    text-decoration: none;
    flex: 0 0 auto;
    width: auto;
}

.homeShotTimerButton {
    background: #2563eb;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
}

.homeShotTimerButton:visited {
    color: white;
}

.homeInfoCard {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

.homeAppBadges {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.homeAppBadges a {
    display: inline-flex;
    align-items: center;
}

.homeAppBadges img {
    height: 48px;
    width: auto;
    max-width: 100%;
}

@media (max-width: 767px) {
    .homeShotTimerCard {
        padding: 16px;
        max-width: 100%;
    }

    .homeShotTimerContent {
        flex: 1 1 200px;
    }

    .homeShotTimerLink {
        width: auto;
    }

    .homeShotTimerButton {
        width: auto;
    }

    .homeInfoCard {
        max-width: 100%;
        padding: 16px;
    }
}

@media (min-width: 768px) {
    .homeFeatures {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .homeFeatureCard {
        flex: 1 1 220px;
        max-width: 280px;
        margin: 20px 0;
    }
}


.heading {
    font-size: 20px;
    font-family: var(--sp-font);
    font-weight: 700;
}

.pageContainer {
    display: flex;
    flex-direction: column;
    min-height: 500px;
    margin: 20px;
}

/* Responsive helpers for settings pages */
.responsiveStack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
}

.settingsBox {
    /* allow natural sizing on mobile; grow into columns on larger screens */
    /* Ensure boxes fit within the viewport on small screens */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 900px) {
    .responsiveStack {
        flex-direction: row;
    }
    .settingsBox {
        flex: 1 1 320px;
    }
}

.hStack {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

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

.hStackCentred {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.clickable {
    cursor: pointer;
}

.buttonContainer {
    width: fit-content
}

.suggest {
    cursor: pointer;
}

.suggest:hover {
    background-color: lightgrey;
}

/* Modal styles for admin firearms edit */
.modalBackdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modalCard {
    background: #ffffff;
    padding: 16px;
    border-radius: 6px;
    width: 90%;
    max-width: 640px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modalTitle {
    font-family: var(--sp-font);
    font-size: 18px;
    font-weight: 700;
}

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

.modalActions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.closeButton {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

/* Admin icon grid (web-only) */
.adminIconGrid {
    display: flex;
    flex-wrap: wrap;
    min-height: 460px;
    margin: 40px auto;
    width: 90%;
    justify-content: flex-start; /* mobile: pack from left */
}

.adminIconItem {
    width: 50%; /* exactly two columns on small screens */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.adminIconCard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.adminIconLabel {
    font-size: 18px; /* ~ lg */
}

@media (min-width: 768px) {
    .adminIconGrid {
        width: 50%;
        justify-content: space-between;
        gap: 16px; /* match prior md spacing */
    }
    .adminIconItem {
        width: auto;
        margin-bottom: 16px;
    }
}
