/* =========================================================
   Booster Club Admin Panel – Global Styles
   Author: Scott Mehring
   ========================================================= */

/* --- Base Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  background-color: #f9fafb;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Layout --- */
header {
  background-color: #003366;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
}

main {
  flex: 1;
  padding: 1rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Top Bar --- */
.top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.top-bar h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  background-color: #0069d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:hover,
.btn:focus {
  background-color: #004b9a;
}

.btn:active {
  transform: scale(0.97);
}

.btn-secondary {
  background-color: #6b7280;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-danger {
    background: #c62828;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #b71c1c;
}

/* Normalize Download/Delete button sizes */
.btn-small {
    padding: 0.55rem 1rem;   /* match .btn exactly */
    font-size: 0.95rem;
}

/* Action buttons aligned horizontally */
.file-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;  /* stops wrapping */
}

.file-actions form {
    display: inline-flex; /* keeps button on same line as link */
    margin: 0;
    padding: 0;
}

.file-actions .btn,
.file-actions button.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 110px;
    height: 40px;
    padding: 0;
}

/* Right-align the Actions column */
.actions-cell {
    text-align: right !important;
    width: 1%;               /* shrinks the column as small as possible */
    white-space: nowrap;     /* prevents wrapping */
}

/* Ensure the button group aligns right inside the cell */
.actions-cell .file-actions {
    justify-content: flex-end;
}

/* Keep buttons on one line */
.file-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

th {
  background-color: #003366;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.8rem;
}

tr:hover {
  background-color: #f3f4f6;
}

/* --- Search Box --- */
.search-box input[type="text"] {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 200px;
  transition: border-color 0.2s;
}

.search-box input[type="text"]:focus {
  outline: none;
  border-color: #0069d9;
}


/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

/* --- Forms --- */
.form-card {
  background: #fff;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full {
  grid-column: span 2;
}

label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
select {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: #0069d9;
}

.form-check {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.alert {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* =========================================================
   MOBILE OPTIMIZED LAYOUT (≤ 768px)
   ========================================================= */
@media (max-width: 768px) {

    /* Header adjustments */
    header h1 {
        font-size: 1.1rem;
    }

    /* Form grid becomes single column */
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    /* TABLE → CARD LAYOUT */
    table.data-table {
        border: none !important;
        box-shadow: none !important;
    }

    /* Fully hide table header */
    table.data-table thead,
    table.data-table thead tr,
    table.data-table th {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Make each row a card */
    table.data-table tr {
        display: block;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Each cell as label + value */
    table.data-table td {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
        border: none !important;
    }

    table.data-table td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: #333;
        display: inline-block;
        margin-right: 4px;
    }

    /* -------- ACTION BUTTONS -------- */
    .actions-cell {
        text-align: center !important;
        margin-top: 1rem;
    }

.actions-cell::before {
    content: "";
    display: none !important;
}


    .file-actions {
        display: flex !important;
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
        width: 100%;
        margin-top: 0.5rem;
    }

    .file-actions .btn {
        width: 48%;
        min-width: 140px;
        height: 42px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.95rem;
    }

    .file-actions form {
        display: inline-flex !important;
        margin: 0;
        padding: 0;
    }
}
