/* =========================================================
   GLOBAL / UNIVERSAL SITE STYLES
   Applies across the entire site
   page_ver: 1.13
   ========================================================= */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #c2c3c4;
}

a, a:hover, a:active, a:visited {
    color: white;
    text-decoration: none;
}

/* ---------- Layout ---------- */
.container {
    max-width: 800px;
    margin: 18px auto;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    text-align: center;
}

/* Helper: widen container to ~80% when pages add "container-80" */
.container.container-80 { width: 80% !important; max-width: 80% !important; }
@media (max-width: 900px) {
  .container.container-80 { width: 95% !important; max-width: 95% !important; }
}

/* Helper: constrain inner content to 80% of the white box and center it */
.mainbodybox-content { width: 80%; margin: 0 auto; }
@media (max-width: 900px) {
  .mainbodybox-content { width: 95%; }
}

h2 { font-size: 2em; margin-bottom: 10px; }
p { font-size: 1.2em; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2em;
    text-decoration: none;
    color: #fff;
    width: 260px;
    text-align: center;
}

.btn-success { background: #28a745; }
.btn-primary { background: #007bff; }
.btn-danger  { background: #dc3545; }
.btn-secondary {
    background: #6c757d;
    color: #fff !important;
    border: 1px solid #555;
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-block;
    text-align: center;
}
.btn-secondary:hover { background: #5a6268; }

.btn-outline {
    display: inline-block;
    padding: 8px 14px;
    border: 2px solid #007bff;
    color: #007bff !important;
    background: transparent;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s ease;
}
.btn-outline:hover {
    background: #007bff;
    color: #fff !important;
}

.btn-compact {
    padding: 6px 10px;
    font-size: 0.8em;
}

.error { color: red; font-weight: bold; }

/* ---------- Topbar / Nav ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    padding: 10px 16px;
    color: #fff;
}

.logo-goat { width: 100px; height: 100px; }
.logo-team { width: 100px; height: 100px; }

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 1.6em;
    font-weight: bold;
}
.topbar-center {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex: 1;
}
.topbar-center a {
    color: #fff;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: bold;
}
.topbar-center a:hover { text-decoration: underline; }

.topbar-right {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    font-weight: bold;
}

/* Dropdown */
.dropdown { position: relative; }
.dropbtn {
    background: #111;
    color: #fff;
    font-size: 1.3em;
    font-weight: bold;
    border: none;
    cursor: pointer;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: #fff;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
}
.dropdown-content a {
    color: #111;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 1.2em;
}
.dropdown-content a:hover { background: #ddd; }
.dropdown:hover .dropdown-content { display: block; }
.dropdown:hover .dropbtn { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 12px;
    background: #111;
    color: #fff;
    margin-top: 20px;
    font-size: 0.9em;
}

/* ---------- Forms ---------- */
label { display: block; font-weight: bold; margin-top: 10px; font-size: 1.1em; }
input, select, textarea {
    width: 100%;
    padding: 8px;
    margin-top: 6px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1.1em;
}

/* ---------- Popup (Universal) ---------- */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1990;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.popup-content {
    background: #fff;
    color: #111;
    font-size: 2em;
    font-weight: bold;
    padding: 30px 50px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transform: scale(1);
    transition: transform 0.2s ease-in-out;
}

/* ---------- Generic Tables ---------- */
table a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}
table a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ccc;
}
.styled-table th, .styled-table td {
    border: 1px solid #ccc;
    padding: 10px 12px;
    text-align: left;
    color: #111;
}
.styled-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}
.styled-table tr:nth-child(even) { background-color: #fafafa; }
.styled-table tbody tr:hover { background-color: #f1f1f1; }
.styled-table thead th {
    position: sticky;
    top: 0;
    background: #f4f4f4;
    z-index: 2;
}

/* User Tables */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.users-table thead {
    background: #007bff;
    color: #fff;
    text-align: left;
    font-size: 1em;
}
.users-table th, .users-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}
.users-table tbody tr:nth-child(even) { background: #f9f9f9; }
.users-table tbody tr:hover { background: #f1f1f1; }
.users-table a.btn-link {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 6px;
    transition: 0.2s ease-in-out;
}
.users-table a.btn-link:hover { background: #007bff; color: #fff; }

/* Legacy user-table (compatibility) */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.user-table th, .user-table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
}
.user-table th { background: #f5f5f5; }
.user-table tr:nth-child(even) { background: #fafafa; }
.btn-link {
    color: #007bff;
    text-decoration: underline;
    font-weight: bold;
}
.btn-link:hover { color: #0056b3; }

/* Pagination */
.pagination {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-weight: bold;
}
.pagination a {
    padding: 6px 12px;
    background: #007bff;
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none;
}
.pagination a:hover { background: #0056b3; }

thead th.sorted-asc::after  { content: " ▲"; font-size: 0.9em; }
thead th.sorted-desc::after { content: " ▼"; font-size: 0.9em; }
thead th { user-select: none; }

/* =========================================================
   PAGE-SPECIFIC STYLES
   ========================================================= */

/* --- index.php --- */
.index-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

/* --- view_equipment.php --- */
.container.container-wide {
    max-width: 75% !important;
    width: 75% !important;
    margin: 18px auto;
    text-align: left;
}
@media (min-width: 1800px) {
    .container.container-wide {
      width: 75% !important;
      max-width: 1600px !important;
    }
}
@media (max-width: 900px) {
    .container.container-wide {
        max-width: 95% !important;
        width: 95% !important;
    }
}

.styled-table { margin: 0 auto; }
.container.container-wide .styled-table { width: 95%; margin: 0 auto; }

.filters {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: flex-start;
    margin: 12px 0 16px;
}
.filters select, .filters input[type="text"] { min-width: 260px; }

.filter-stack {
    display: flex;
    flex-direction: row;
    gap: 10px;
}
@media (max-width: 900px) {
  .filters {
    flex-direction: row;
    gap: 12px;
  }
  .filters select, .filters input[type="text"] {
    width: 100%;
    min-width: 0;
  }
}

.toolbar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 10px 0 5px;
}

/* --- sql.php --- */
.sql-wrap { padding: 24px 12px; }
.sql-card { margin: 0 auto 24px auto; }
.sql-card.border-danger { border-width: 2px !important; }
.sql-box {
    width: clamp(560px, 75%, 900px);
    margin: 0 auto;
}
.sql-textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    min-height: 9em;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}
.table-responsive {
    max-height: 60vh;
    overflow: auto;
}
.btn-col {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: 150px;
    margin: 0 auto;
}

/* --- workorders.php + detail pages --- */
.wo-table { min-width: 1200px; }
.wo-table th, .wo-table td { padding: 6px 8px; }
.wo-table tbody tr { height: 44px; }

.row-clickable { cursor: pointer; }
.row-clickable:hover { background-color: #eef5ff !important; }

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
}

.detail-wrap { background:#fff; }
.detail-table th {
    width: 220px;
    white-space: nowrap;
}
.detail-table td { max-width: 100%; }

.image-row { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
    max-height: 100px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
}

/* --- add_equipment.php --- */
#manufacturerSelect,
#newManufacturerInput,
select[name="venue_id"] {
    height: 2.2em;
    font-size: 1.1em;
}
.spacer { height: 2em; }
.form-space { height: 2em; }

#newManufacturerContainer {
    margin-top: 10px;
    display: none;
}

.error-message {
    color: red;
    margin: 5px 0;
}
.success-message {
    color: green;
    font-weight: bold;
    margin: 10px 0;
}

.btn + .btn { margin-left: 10px; }

/* ---------- Image Modal (GLOBAL) ---------- */
.image-modal {
    display: none;                      /* hidden by default */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;                /* center content vertically */
    justify-content: center;            /* center content horizontally */
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
}
.image-modal.open { display: flex; }     /* shown when JS adds .open */

.image-modal .img-wrap {
    max-width: 80%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-modal .img-wrap img {
    max-width: 100%;
    max-height: 100%;
    border: 5px solid #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Close “X” button (better visibility) */
.image-modal .closebtn {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 36px;         /* ~150% larger than before */
    font-weight: 800;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 6px 10px;
}
.image-modal .closebtn:hover { transform: scale(1.15); }

/* Left/Right nav arrows (only shown when multiple images) */
.image-modal .navbtn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 46px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 50%;
    width: 56px; height: 56px;
    cursor: pointer;
    display: none;           /* toggled by JS based on count */
}
.image-modal .navbtn.left  { left: 24px; }
.image-modal .navbtn.right { right: 24px; }
.image-modal .navbtn:hover { background: rgba(0,0,0,0.5); }

/* =========================================================
   END OF FILE
   ========================================================= */
