/* NFL Survivor League - clean, fully responsive styles */

:root {
    --touch-min: 44px; /* recommended minimum touch target */
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
}

main {
    flex: 1;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Status badges */
.badge-alive {
    background-color: #198754;
}
.badge-eliminated {
    background-color: #dc3545;
}
.badge-unverified {
    background-color: #6c757d;
}
.badge-verified {
    background-color: #0d6efd;
}

.table-sm td,
.table-sm th {
    vertical-align: middle;
}

/* Team pick buttons */
.pick-team-btn {
    min-width: 4.5rem;
    min-height: var(--touch-min);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-alive { background: #198754; }
.status-out { background: #dc3545; }
.status-pending { background: #ffc107; }

/* Team pick grid */
.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
    gap: 0.5rem;
}

/* Improve form controls on touch devices */
.form-control,
.form-select,
.btn {
    min-height: 38px;
}

.btn-sm {
    min-height: 34px;
}

/* Navbar brand truncation on very small screens */
.navbar-brand {
    max-width: 60vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card headers that stack on mobile */
.card-header-mobile-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    align-items: center;
}

/* ========== Tablet and below ========== */
@media (max-width: 991.98px) {
    .container,
    .container-fluid {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    /* Admin tables: slightly denser */
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* ========== Mobile phones ========== */
@media (max-width: 767.98px) {
    /* Tighter vertical rhythm */
    main.container,
    main.container-fluid {
        padding-bottom: 2rem;
    }

    h1.h3,
    .h3 {
        font-size: 1.35rem;
    }

    /* Cards */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    /* Full-width primary actions */
    .btn-block-mobile {
        display: block;
        width: 100%;
    }

    /* Pick buttons – larger touch targets */
    .pick-team-btn {
        min-width: 0;
        min-height: var(--touch-min);
        padding: 0.5rem 0.35rem;
        font-size: 0.9rem;
    }

    .pick-grid {
        grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
        gap: 0.4rem;
    }

    /* Stack card header content (week label + deadline) */
    .card-header.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.25rem;
    }

    .card-header .small {
        font-size: 0.8rem;
    }

    /* Tables on mobile */
    .table-responsive {
        font-size: 0.8125rem;
        margin-bottom: 0;
        border: 0;
    }

    .table-sm td,
    .table-sm th {
        padding: 0.45rem 0.4rem;
        white-space: nowrap;
    }

    /* Dashboard / action buttons stack */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }

    .btn-group-mobile .btn {
        width: 100%;
    }

    /* Standings list items */
    .list-group-item {
        padding: 0.75rem 1rem;
    }

    /* Messages conversation bubbles */
    .list-group-item .d-flex {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* Forms – full width buttons */
    form .btn[type="submit"]:not(.btn-sm) {
        width: 100%;
    }

    /* Reduce large hero padding */
    .card-body.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

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

    .lead {
        font-size: 1rem;
    }

    /* Admin side-by-side forms become stacked */
    .admin-inline-form {
        flex-direction: column;
    }

    /* Hide less critical columns on very small screens if needed */
    .d-mobile-none {
        display: none !important;
    }
}

/* ========== Very small phones ========== */
@media (max-width: 399.98px) {
    .navbar-brand {
        font-size: 0.95rem;
        max-width: 55vw;
    }

    .pick-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .badge {
        font-size: 0.7rem;
    }

    .container {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }
}

/* Prevent iOS zoom on input focus (font-size >= 16px) */
@media (max-width: 767.98px) {
    input.form-control,
    select.form-select,
    textarea.form-control {
        font-size: 16px;
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}
