/* ═══════════════════════════════════════════════════════════════════
   COMPUTER LAB CHECKLIST REPORT — Custom Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Google Fonts Import ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS Custom Properties ──────────────────────────────────────── */
:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --success: #10B981;
    --success-light: #D1FAE5;
    --success-dark: #065F46;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --danger-dark: #991B1B;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --warning-dark: #92400E;
    --info: #06B6D4;
    --info-light: #CFFAFE;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

/* ─── Base ────────────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

/* ─── Page Header ─────────────────────────────────────────────────── */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.page-header h1 {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.page-header .subtitle {
    opacity: 0.85;
    font-weight: 400;
    font-size: 0.95rem;
}

.page-header .header-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.page-header .header-meta i {
    margin-right: 0.35rem;
}

/* ─── Header Layout ───────────────────────────────────────────────── */
.header-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: rgba(255,255,255,0.15);
    padding: 4px;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* ─── Action Buttons (mobile-safe) ────────────────────────────────── */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    color: white;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s ease, transform 0.15s ease;
    min-height: 44px; /* iOS minimum tap target */
    min-width: 44px;
}

.btn-action:hover {
    background: rgba(255,255,255,0.35);
    color: white;
    transform: translateY(-1px);
}

.btn-action:active {
    background: rgba(255,255,255,0.45);
    transform: translateY(0);
}

.btn-action-ghost {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.btn-action-ghost:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* ─── Room Section ────────────────────────────────────────────────── */
.room-section {
    margin-bottom: 2.5rem;
}

.room-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 3px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.room-title i {
    color: var(--primary);
    font-size: 1.2rem;
}

/* ─── Row Section ─────────────────────────────────────────────────── */
.row-section {
    margin-bottom: 1.75rem;
}

.row-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.85rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.row-title i {
    color: var(--primary-light);
    font-size: 0.9rem;
}

/* ─── PC Card ─────────────────────────────────────────────────────── */
.pc-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.pc-card-header {
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pc-card-header h5 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    color: var(--gray-800);
    white-space: nowrap;
}

.pc-card-body {
    padding: 1rem;
    flex: 1;
}

/* ─── Checklist Items ─────────────────────────────────────────────── */
.checklist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.15s ease;
}

.checklist-item:hover {
    background: var(--gray-50);
}

.checklist-item .icon-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.checklist-item.checked .icon-check {
    background: var(--success-light);
    color: var(--success-dark);
}

.checklist-item.unchecked .icon-check {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.checklist-item.checked .label {
    color: var(--gray-700);
}

.checklist-item.unchecked .label {
    color: var(--danger);
    text-decoration: line-through;
    opacity: 0.75;
}

/* ─── Status Badge ────────────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.status-ready {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-repair, .status-broken {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.status-off {
    background: var(--gray-200);
    color: var(--gray-600);
}

.status-other {
    background: var(--warning-light);
    color: var(--warning-dark);
}

/* ─── Photo (1:1 aspect ratio, no cropping) ───────────────────────── */
.pc-photo {
    margin-top: 0.75rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 aspect ratio */
}

.pc-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--gray-50);
    display: block;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.pc-photo img:hover {
    transform: scale(1.05);
}

/* ─── Status Footer ───────────────────────────────────────────────── */
.pc-card-footer {
    padding: 0.65rem 1rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── Filter Bar ──────────────────────────────────────────────────── */
.filter-bar {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-bar label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

.filter-bar select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    color: var(--gray-700);
    background: white;
    transition: border-color 0.2s ease;
    min-height: 44px;
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ─── Summary Stats ───────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.total { background: #EEF2FF; color: var(--primary); }
.stat-card .stat-icon.ready { background: var(--success-light); color: var(--success); }
.stat-card .stat-icon.repair { background: var(--danger-light); color: var(--danger); }
.stat-card .stat-icon.rooms { background: var(--info-light); color: var(--info); }

.stat-card .stat-info .stat-number {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-card .stat-info .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Footer ──────────────────────────────────────────────────────── */
.page-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--gray-400);
    font-size: 0.8rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 3rem;
}

/* ─── Photo Modal ─────────────────────────────────────────────────── */
.photo-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 2rem;
}

.photo-modal-backdrop.active {
    display: flex;
}

.photo-modal-backdrop img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
    object-fit: contain;
}

/* ─── PC Detail Modal (Mobile View) ───────────────────────────────── */
.pc-modal-content {
    border-radius: var(--radius-lg, 16px);
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.pc-modal-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
}

.pc-modal-location {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.pc-modal-header .modal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.pc-modal-body {
    padding: 1.25rem;
}

.modal-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pc-modal-body .checklist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.pc-modal-body .checklist-item {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    background: var(--gray-50);
}

.pc-modal-body .pc-photo {
    margin-top: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    width: 100%;
    padding-top: 75%;
}

.pc-modal-footer-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 0.78rem;
}

.pc-modal-footer {
    border-top: none;
    padding: 0 1.25rem 1.25rem 1.25rem;
}

/* ─── No Data ─────────────────────────────────────────────────────── */
.no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   PRINT STYLES — A4 Landscape (larger, more readable)
   ═══════════════════════════════════════════════════════════════════ */
@media print {
    @page {
        size: A4 landscape;
        margin: 10mm 12mm;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }

    .page-header {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 0.75rem 0;
        margin-bottom: 0.75rem;
    }

    .page-header h1 {
        font-size: 16pt;
    }

    .page-header .subtitle {
        font-size: 10pt;
    }

    .page-header .header-meta {
        font-size: 9pt;
    }

    .container {
        max-width: 100% !important;
        padding: 0 5mm !important;
    }

    .pc-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #bbb;
    }

    .pc-card:hover {
        transform: none;
        box-shadow: none;
    }

    .pc-card-header h5 {
        font-size: 10pt;
    }

    .checklist-item {
        font-size: 9pt;
    }

    .status-badge {
        font-size: 8pt;
    }

    .pc-photo {
        padding-top: 60%; /* Shorter ratio for print to save space */
    }

    .pc-photo img {
        object-fit: contain;
    }

    .pc-photo img:hover {
        transform: none;
    }

    .row-section {
        break-inside: avoid;
    }

    .room-section {
        break-before: auto;
    }

    .stats-bar {
        display: flex;
    }

    .stat-card {
        box-shadow: none;
        border: 1px solid #ccc;
        padding: 0.5rem 0.75rem;
    }

    .stat-card .stat-info .stat-number {
        font-size: 14pt;
    }

    .stat-card .stat-info .stat-label {
        font-size: 7pt;
    }

    .filter-bar {
        display: none !important;
    }

    .page-footer {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        font-size: 8pt;
    }

    .pc-card-footer small {
        font-size: 7pt !important;
    }

    a {
        text-decoration: none !important;
        color: inherit !important;
    }

    .checklist-item:hover {
        background: transparent;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Tablets & small screens ─────────────────────────────────────── */
@media (max-width: 768px) {
    .page-header {
        padding: 1.25rem 0;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .page-header .subtitle {
        font-size: 0.82rem;
    }

    .header-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
    }

    .btn-action {
        flex: 1;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        min-width: unset;
        padding: 0.85rem 1rem;
    }

    .stat-card .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .stat-card .stat-info .stat-number {
        font-size: 1.15rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filter-bar select {
        width: 100%;
    }

    .room-title {
        font-size: 1.15rem;
    }

    /* Mobile 2-column compact PC cards */
    .pc-card {
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
        border-radius: var(--radius-sm);
    }

    .pc-card:active {
        transform: scale(0.96);
        box-shadow: var(--shadow-sm);
    }

    .pc-card.status-ready {
        border-left: 4px solid var(--success) !important;
    }

    .pc-card.status-repair,
    .pc-card.status-broken {
        border-left: 4px solid var(--danger) !important;
    }

    .pc-card.status-off {
        border-left: 4px solid var(--gray-400) !important;
    }

    .pc-card.status-other {
        border-left: 4px solid var(--warning) !important;
    }

    /* Hide full body, footer, and status badge on mobile card tile */
    .pc-card .pc-card-body,
    .pc-card .pc-card-footer {
        display: none !important;
    }

    .pc-card-header .status-badge {
        display: none !important;
    }

    .pc-card-header {
        padding: 0.9rem 0.5rem;
        justify-content: center;
        text-align: center;
        min-height: 56px;
        border-bottom: none;
        background: white;
    }

    .pc-card-header h5 {
        font-size: 0.95rem;
        font-weight: 700;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        color: var(--gray-800);
    }
}

/* ─── Small phones ────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.1rem;
    }

    .page-header h1 i {
        display: none;
    }

    .header-meta {
        font-size: 0.75rem !important;
        flex-wrap: wrap;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card .stat-info .stat-label {
        font-size: 0.65rem;
    }

    .pc-card-header {
        padding: 0.85rem 0.4rem;
        min-height: 52px;
    }

    .pc-card-header h5 {
        font-size: 0.9rem;
    }

    .checklist-grid {
        grid-template-columns: 1fr 1fr; /* Keep 2 columns on mobile */
    }

    .checklist-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.35rem;
        gap: 0.3rem;
    }

    .checklist-item .icon-check {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .pc-photo {
        padding-top: 100%;
    }

    .status-badge {
        font-size: 0.7rem;
    }

    .room-title {
        font-size: 1.05rem;
    }

    .row-title {
        font-size: 0.9rem;
    }
}

/* ─── Very small phones (iPhone SE etc.) ──────────────────────────── */
@media (max-width: 375px) {
    .page-header h1 {
        font-size: 1rem;
    }

    .btn-action {
        padding: 0.65rem 0.75rem;
        font-size: 0.82rem;
    }

    .stat-card {
        padding: 0.7rem 0.75rem;
        gap: 0.5rem;
    }

    .stat-card .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .stat-card .stat-info .stat-number {
        font-size: 1rem;
    }
}
