/* ============================================================
   THEME COLORS — SAME BRANDING AS MAINTENANCE REQUEST PORTAL
   ============================================================ */
:root {
    --primary: #2a385d;
    --primary-rgb: 42, 56, 93;

    --secondary: #83a757;
    --secondary-rgb: 131, 167, 87;

    --light-text: #e8e6df;
    --supp-1: #a69f88;
    --supp-2: #c3d7ee;

    /* Bootstrap variable overrides */
    --bs-primary: var(--primary);
    --bs-primary-rgb: var(--primary-rgb);
    --bs-secondary: var(--secondary);
    --bs-secondary-rgb: var(--secondary-rgb);
    --bs-link-color: var(--primary);
    --bs-link-hover-color: #1f2b47;
}

/* ============================================================
   GLOBAL RESET + BODY
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* ============================================================
   HEADER
   ============================================================ */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.main-header .container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content {
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.content h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.content p {
    font-size: 16px;
    color: #555;
}

/* ============================================================
   RESIDENT / TECHNICIAN VERIFY FORM
   ============================================================ */
.resident-form,
.verify-form,
.card {
    margin-top: 30px;
    margin-bottom: 30px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    justify-content: space-between;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.form-group label {
    margin-bottom: 6px;
    font-weight: bold;
    color: #444;
}

.form-group input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ============================================================
   BUTTONS — MATCH MR BRANDING
   ============================================================ */
button[type="submit"],
.btn-primary,
.btn-success,
.btn-warning {
    padding: 12px 20px;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--light-text) !important;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
}

button[type="submit"]:hover,
.btn-primary:hover,
.btn-success:hover,
.btn-warning:hover {
    background-color: #1f2b47 !important;
    border-color: #1f2b47 !important;
}

/* ============================================================
   TABLES / WORK ORDER LIST
   ============================================================ */
.work-orders-section {
    margin-top: 50px;
    padding-left: 3%;
    padding-right: 3%;
}

.work-orders-section h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.work-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.work-orders-table th,
.work-orders-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.work-orders-table thead {
    background-color: #f7f7f7;
    font-weight: 600;
    color: #333;
}

.work-orders-table tbody tr:hover {
    background-color: #f0f8ff;
}

.work-orders-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

/* Clickable Issue */
.work-orders-table td.clickable-issue {
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
}

.work-orders-table td.clickable-issue:hover {
    color: #1f2b47;
}

/* ============================================================
   RESPONSIVE TABLE
   ============================================================ */
@media (max-width: 600px) {
    .work-orders-table thead { display: none; }
    .work-orders-table,
    .work-orders-table tbody,
    .work-orders-table tr,
    .work-orders-table td { display: block; width: 100%; }

    .work-orders-table tr {
        margin-bottom: 16px;
        border: 1px solid #ddd;
        border-radius: 6px;
        box-shadow: 0 0 5px rgba(0,0,0,0.05);
    }

    .work-orders-table td {
        padding: 10px 14px;
        text-align: right;
        position: relative;
        white-space: normal;
    }

    .work-orders-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 14px;
        text-align: left;
        font-weight: bold;
        color: #555;
    }
}

/* ============================================================
   MODALS — UNIFIED BRANDING
   ============================================================ */
.modal-header {
    background-color: var(--primary) !important;
    border-bottom: 1px solid var(--primary);
    color: var(--light-text) !important;
}

.modal-title {
    font-weight: 600;
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: black;
}

/* ============================================================
   ISSUE DETAILS MODALS / RELATED ISSUES
   ============================================================ */
.related-issue-entry {
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.related-issue-entry:hover {
    background-color: #f8f9fa;
}

.view-more-link {
    color: var(--primary);
    text-decoration: underline;
    margin-left: 6px;
}

.issue-desc-row td {
    padding: 1.5rem;
}

.issue-spacer td {
    height: 0.5rem;
}

/* custom banners used in modal */
.badge.text-bg-custom-purple {
    background-color: #6f42c1 !important;
    color: #fff !important;
}

.badge.text-bg-custom-brown {
    background-color: #8B4513 !important;
    color: #fff !important;
}

.custom-purple-banner {
    background-color: #6f42c1 !important;
    color: #fff !important;
}

.custom-brown-banner {
    background-color: #8B4513 !important;
    color: #fff !important;
}

/* ============================================================
   ENV BANNER (IF USED)
   ============================================================ */
#env-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 8px 0;
    text-align: center;
    background: #ffc107;
    color: black;
    z-index: 2000;
}

body.env-has-banner {
    padding-top: 48px;
}

/* ============================================================
   BUTTON LOADING SPINNER
   ============================================================ */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.6);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spinner 0.7s linear infinite;
}

@keyframes btn-spinner {
    to { transform: rotate(360deg); }
}

/* ============================================================
   ENVIRONMENT BANNER
   ============================================================ */

/* Banner styles (only when shown) */
#env-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 8px 0;
    text-align: center;
    background: #ffc107;
    color: black;
    z-index: 2000;
}

/* Only add spacing if an env banner is shown */
body.env-has-banner {
    padding-top: 48px;   /* same height as banner */
}
