/* ── Site Plates — Screen Styles ── */

.plate-page {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 700px;
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
}

.plate-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    border-bottom: 3px solid #1a1a2e;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

/* 1. SITE CODE — dominant element, instant identification */
.plate-site-code-box {
    font-family: monospace;
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    background: #dc3545;
    padding: 8px 20px;
    border-radius: 4px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-align: center;
    display: flex;
    align-items: center;
    min-width: 90px;
}

/* 2. SITE NAME — clear identity, secondary to code */
.plate-site-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Badge row — site type + auth pill side by side */
.plate-badge-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 2px;
}

/* 3. SITE TYPE — category context, not competing */
.plate-type-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
    background: #495057;
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 0.1em;
}

/* Auth pill — next to site type */
.plate-auth-pill {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 0.1em;
}
.plate-auth-pill.plate-auth-ok { background: #d4edda; color: #155724; }
.plate-auth-pill.plate-auth-limited { background: #fff3cd; color: #856404; }
.plate-auth-pill.plate-auth-prohibited { background: #f8d7da; color: #721c24; }
.plate-auth-pill.plate-auth-none { background: #e2e3e5; color: #6c757d; }

/* Auth reason/limitations — inline next to pill */
.plate-auth-reason-inline {
    font-size: 0.65rem;
    font-weight: 600;
    color: #856404;
}

/* 4. CITY — geographic context, subordinate */
.plate-city {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 400;
}

.plate-identifiers {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

.plate-siteref {
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    background: #f0f0f0;
    padding: 1px 8px;
    border-radius: 3px;
}

.plate-waypoint {
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0d47a1;
    background: #e3f2fd;
    padding: 1px 8px;
    border-radius: 3px;
}

/* Contact & Helipad info grid */
.plate-info-grid {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 4px;
}

.plate-info-cell {
    display: flex;
    flex-direction: column;
    padding: 3px 10px;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.plate-info-cell:last-child {
    border-right: none;
}

.plate-info-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.05em;
}

.plate-info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
}

/* Inline authorisation badge (compact) */
.plate-auth-inline {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Hazard colour coding (survey severity) */
.plate-hazard {
    margin: 3px 0;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 1rem;
}

.plate-hazard-avoid {
    background: #f8d7da;
    color: #721c24;
    font-weight: 700;
    border-left: 4px solid #dc3545;
}

.plate-hazard-caution {
    background: #fff3cd;
    color: #856404;
    font-weight: 600;
    border-left: 4px solid #ffc107;
}

/* Footer with provenance */
.plate-footer-provenance {
    flex-direction: column;
    gap: 2px;
}

.plate-footer-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.85rem;
}

/* Authorisation block */
.plate-auth {
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 4px;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.plate-auth-ok { background: #d4edda; color: #155724; border: 2px solid #28a745; }
.plate-auth-limited { background: #fff3cd; color: #856404; border: 2px solid #ffc107; }
.plate-auth-prohibited { background: #f8d7da; color: #721c24; border: 2px solid #dc3545; }
.plate-auth-none { background: #e2e3e5; color: #6c757d; border: 2px solid #adb5bd; }
.plate-auth-detail { font-size: 0.7rem; font-weight: 400; text-transform: none; margin-top: 3px; }

/* Body layout */
.plate-body {
    flex: 1;
}

.plate-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.plate-col-map {
    flex: 1;
    min-width: 0;
}

.plate-col-info {
    flex: 1;
    min-width: 0;
}

.plate-map {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.plate-map-full {
    height: 340px;
    margin-bottom: 8px;
}

.plate-info-strip {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* Airspace overlay maps — transparent background so base maps show through */
[id^="plate-airspace-"],
[id^="plate-sat-airspace-"] {
    background: transparent !important;
}
[id^="plate-airspace-"] .leaflet-control-container,
[id^="plate-sat-airspace-"] .leaflet-control-container {
    display: none;
}

/* Tables */
.plate-table {
    width: 100%;
    font-size: 1rem;
    border-collapse: collapse;
}

.plate-table th {
    text-align: left;
    font-weight: 600;
    color: #495057;
    padding: 5px 10px 5px 0;
    white-space: nowrap;
    width: 1%;
    vertical-align: top;
}

.plate-table td {
    padding: 5px 6px;
    color: #212529;
}

.plate-table-full {
    border: 1px solid #dee2e6;
}

.plate-table-full th,
.plate-table-full td {
    border: 1px solid #dee2e6;
    padding: 6px 10px;
}

.plate-table-full thead th {
    background: #f8f9fa;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Sections */
.plate-section {
    margin-bottom: 8px;
}

.plate-section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    font-weight: 700;
    margin-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 2px;
}

.plate-text {
    font-size: 1rem;
    color: #212529;
    margin-bottom: 4px;
    white-space: pre-line;
}

.plate-caution {
    color: #dc3545;
    font-weight: 600;
}

.plate-text-ok {
    color: #28a745;
    font-weight: 500;
}

/* Procedures side-by-side */
.plate-procedures {
    display: flex;
    gap: 12px;
}

.plate-procedure-block {
    flex: 1;
}

/* Suitability row highlights */
.plate-row-danger td { background: #fff5f5; }
.plate-row-warning td { background: #fffbeb; }
.plate-suitability { font-weight: 600; }

/* Issues summary */
.plate-issues-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 1rem;
}

.plate-issue-count {
    font-weight: 600;
    color: #dc3545;
}

.plate-risk {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
}

.plate-risk-critical { background: #f8d7da; color: #721c24; }
.plate-risk-high { background: #fff3cd; color: #856404; }
.plate-risk-medium { background: #d1ecf1; color: #0c5460; }

/* Footer */
.plate-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #dee2e6;
    padding-top: 8px;
    margin-top: auto;
    font-size: 0.85rem;
    color: #6c757d;
}

/* ── iPad Portrait (768px) ── */
@media screen and (max-width: 1024px) {
    .plate-page {
        padding: 16px 18px;
    }

    /* Procedures stack vertically on narrow screens */
    .plate-procedures {
        flex-direction: column;
        gap: 12px;
    }
}

/* ── Print Styles ── */
@media print {
    /* Hide app chrome and controls */
    .plate-controls,
    .sidenav-menu,
    .app-topbar,
    .footer,
    .page-title-head {
        display: none !important;
    }

    body, .content-page {
        margin: 0 !important;
        padding: 0 !important;
    }

    .plate-page {
        border: none;
        box-shadow: none;
        margin: 0 auto;
        padding: 8mm;
        max-width: 768px;
        min-height: auto;
        page-break-after: always;
        page-break-inside: avoid;
    }

    .plate-page:last-child {
        page-break-after: auto;
    }

    .plate-map {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .plate-map-full {
        height: 340px;
    }

    .plate-info-grid,
    .plate-site-code-box,
    .plate-type-badge,
    .plate-auth-pill,
    .plate-auth-reason-inline,
    .plate-hazard-avoid,
    .plate-hazard-caution {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .plate-auth,
    .plate-risk,
    .plate-siteref,
    .plate-waypoint,
    .plate-row-danger td,
    .plate-row-warning td {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .plate-table-full thead th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: 190mm 254mm; /* iPad portrait aspect ratio */
        margin: 6mm;
    }
}
