/* RED CELL COMMAND PORTAL Style Sheet */

/* Font Definitions (Military Wargame Skill Standards) */
@font-face {
    font-family: 'THSarabunPSK';
    src: local('TH Sarabun PSK'), local('THSarabunPSK'),
         url('https://raw.githubusercontent.com/Phonbopit/sarabun-webfont/master/fonts/thsarabunnew-webfont.woff') format('woff');
    font-weight: normal;
}
@font-face {
    font-family: 'THSarabunPSK';
    src: local('TH Sarabun PSK Bold'), local('THSarabunPSK-Bold'),
         url('https://raw.githubusercontent.com/Phonbopit/sarabun-webfont/master/fonts/thsarabunnew_bold-webfont.woff') format('woff');
    font-weight: bold;
}

:root {
    --bg-main: #050508;
    --bg-panel: rgba(10, 10, 15, 0.85);
    --bg-card: rgba(18, 18, 26, 0.7);
    --border-color: rgba(255, 30, 39, 0.2);
    --border-color-glow: rgba(255, 30, 39, 0.4);
    
    --primary: #ff1e27;
    --primary-hover: #d6001c;
    --primary-light: rgba(255, 30, 39, 0.08);
    --primary-glow: rgba(255, 30, 39, 0.35);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-gold: #ffd700;
    
    --color-green: #00ff87;
    --color-yellow: #ffb700;
    --color-red: #ff1e27;
    --color-blue: #00d2ff;
    
    --shadow-soft: 0 4px 30px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.02);
    --shadow-glow: 0 0 20px rgba(255, 30, 39, 0.15);
    --shadow-glow-active: 0 0 25px rgba(255, 30, 39, 0.3);
    
    --radius-lg: 8px;
    --radius-md: 6px;
    
    --font-thai: 'THSarabunPSK', 'TH Sarabun PSK', sans-serif;
    --font-eng: 'Outfit', 'Inter', sans-serif;
    --font-hud: 'Orbitron', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 30, 39, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(0, 210, 255, 0.03) 0%, transparent 40%);
    color: var(--text-main);
    font-family: var(--font-thai);
    font-size: 20px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 30px; /* Space for fixed classification header */
}

/* Classification Header */
.classification-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #8b0000;
    color: #ffffff;
    text-align: center;
    font-family: var(--font-hud);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 5px;
    padding: 4px 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Layout Wrapper */
.dashboard-wrapper {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header styling */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
    backdrop-filter: blur(10px);
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent, var(--primary));
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-badge {
    background-color: var(--primary);
    color: #ffffff;
    font-family: var(--font-hud);
    font-weight: 900;
    font-size: 15px;
    padding: 6px 12px;
    border-radius: 4px;
    letter-spacing: 2px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px var(--primary-glow);
}

.brand-title-wrap h1 {
    font-family: var(--font-hud);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, #ff8a8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-title-wrap p {
    font-size: 17px;
    color: var(--text-muted);
}

.header-meta {
    display: flex;
    gap: 24px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-family: var(--font-hud);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.meta-value {
    font-family: var(--font-hud);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.meta-value.status-active {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Dashboard Columns Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

/* Cards */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.card:hover {
    border-color: rgba(255, 30, 39, 0.35);
    box-shadow: var(--shadow-soft), 0 0 15px rgba(255, 30, 39, 0.05);
}

.card-header-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.card-header-hud h2 {
    font-family: var(--font-hud);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-main);
}

.card-header-hud .icon {
    color: var(--primary);
    filter: drop-shadow(0 0 4px var(--primary-glow));
}

/* Spec List (HUD Stats) */
.spec-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    font-size: 19px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.spec-label {
    color: var(--text-muted);
}

.spec-value {
    font-weight: 700;
    color: var(--text-light);
}

.text-red {
    color: var(--primary) !important;
    text-shadow: 0 0 6px var(--primary-glow);
}

.text-yellow {
    color: var(--color-yellow) !important;
}

/* Unit items listing */
.unit-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unit-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 30, 39, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.unit-item:hover {
    background: rgba(255, 30, 39, 0.04);
    border-color: rgba(255, 30, 39, 0.4);
    transform: translateX(4px);
}

.unit-item.active {
    background: rgba(255, 30, 39, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 30, 39, 0.12), inset 0 0 10px rgba(255, 30, 39, 0.05);
}

.unit-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.unit-name {
    font-size: 18px;
    font-weight: 800;
}

.unit-badge {
    font-family: var(--font-hud);
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.unit-badge.strike { background: rgba(255, 30, 39, 0.15); color: var(--primary); border: 1px solid var(--primary); }
.unit-badge.air { background: rgba(0, 210, 255, 0.15); color: var(--color-blue); border: 1px solid var(--color-blue); }
.unit-badge.hybrid { background: rgba(255, 183, 0, 0.15); color: var(--color-yellow); border: 1px solid var(--color-yellow); }
.unit-badge.guard { background: rgba(255, 255, 255, 0.1); color: #ffffff; border: 1px solid rgba(255,255,255,0.2); }
.unit-badge.sub { background: rgba(255, 30, 39, 0.1); color: var(--primary); border: 1px solid var(--primary); }
.unit-badge.logistics { background: rgba(0, 255, 135, 0.12); color: var(--color-green); border: 1px solid var(--color-green); }
.unit-badge.support { background: rgba(0, 210, 255, 0.18); color: var(--color-blue); border: 1px solid var(--color-blue); box-shadow: 0 0 8px rgba(0, 210, 255, 0.2); }
.unit-badge.marine { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid #555; }

.unit-commander {
    font-size: 15px;
    color: var(--text-muted);
}

/* Document Links list */
.doc-links-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-main);
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s ease;
}

.doc-link-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--primary);
}

.doc-link-item .arrow {
    font-family: var(--font-hud);
    font-size: 12px;
    opacity: 0.6;
}

/* Navigation Tabs (Right Column) */
.tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    background: rgba(20, 20, 30, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-thai);
    font-weight: bold;
    font-size: 17px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: white;
    border-color: rgba(255, 30, 39, 0.5);
    background: rgba(255, 30, 39, 0.04);
}

.tab-btn.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: contentFadeIn 0.35s ease-out forwards;
}

.tab-pane.active {
    display: block;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Description Text styling */
.desc-text {
    font-size: 20px;
    color: #e2e8f0;
    line-height: 1.6;
}

.text-justify {
    text-align: justify;
}

/* Phase Timeline (Overview Tab) */
.phase-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.phase-node {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.phase-node.active {
    border-color: var(--primary);
    background: rgba(255, 30, 39, 0.03);
    box-shadow: 0 0 10px rgba(255, 30, 39, 0.05);
}

.phase-num {
    font-family: var(--font-hud);
    font-size: 13px;
    font-weight: 900;
    color: var(--primary);
    background: rgba(255, 30, 39, 0.1);
    border: 1px solid var(--primary);
    padding: 4px 10px;
    border-radius: 4px;
    height: fit-content;
    white-space: nowrap;
}

.phase-detail h3 {
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
}

.phase-detail p {
    font-size: 16px;
    color: var(--text-muted);
}

/* Decisive Points List */
.dp-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dp-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: var(--radius-md);
}

.dp-badge {
    font-family: var(--font-hud);
    font-size: 11px;
    font-weight: 900;
    color: var(--text-gold);
    border: 1px solid var(--text-gold);
    background: rgba(255, 215, 0, 0.05);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.dp-text {
    font-size: 18px;
    color: #e2e8f0;
}

/* 2-Column Grid inside tab pane */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* OPORD Document styling */
.opord-doc-container {
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
    padding: 30px;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.opord-page {
    padding: 10px;
}

.opord-doc-header {
    display: flex;
    flex-direction: column;
    font-size: 17px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.opord-doc-header div {
    margin-bottom: 2px;
}

.opord-title {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.opord-ref {
    text-align: center;
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.opord-section {
    margin-bottom: 28px;
}

.opord-section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

.opord-sub-section {
    margin-left: 16px;
}

.opord-sub-section h4 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-gold);
    margin-top: 14px;
    margin-bottom: 4px;
}

.opord-sub-section p {
    font-size: 19px;
    color: #e2e8f0;
    text-align: justify;
    margin-bottom: 10px;
}

.opord-body-text {
    font-size: 19px;
    color: #e2e8f0;
    text-align: justify;
}

.opord-doc-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 16px;
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 19px;
    font-weight: bold;
}

.opord-doc-footer div {
    margin-bottom: 4px;
}

/* Sync Matrix table styling */
.table-container {
    overflow-x: auto;
    width: 100%;
}

.sync-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.sync-table th, .sync-table td {
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    vertical-align: top;
    font-size: 18px;
}

.sync-table th {
    background: rgba(255, 30, 39, 0.08);
    color: white;
    font-family: var(--font-hud);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sync-table td.unit-col {
    font-weight: 800;
    color: var(--text-gold);
    background: rgba(255, 255, 255, 0.01);
    white-space: nowrap;
}

.sync-table tr:hover td {
    background: rgba(255, 30, 39, 0.02);
}

/* ROE cards styling */
.roe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.roe-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.roe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.roe-card.card-green::before { background-color: var(--color-green); }
.roe-card.card-yellow::before { background-color: var(--color-yellow); }
.roe-card.card-red::before { background-color: var(--color-red); }

.roe-card h3 {
    font-family: var(--font-hud);
    font-size: 15px;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.roe-card.card-green h3 { color: var(--color-green); }
.roe-card.card-yellow h3 { color: var(--color-yellow); }
.roe-card.card-red h3 { color: var(--color-red); }

.roe-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roe-list li {
    font-size: 18px;
    color: #e2e8f0;
    position: relative;
    padding-left: 18px;
}

.roe-list li::before {
    content: '▪';
    position: absolute;
    left: 0;
    top: 0;
}

.roe-card.card-green li::before { color: var(--color-green); }
.roe-card.card-yellow li::before { color: var(--color-yellow); }
.roe-card.card-red li::before { color: var(--color-red); }

/* Detail list styling */
.detail-list {
    margin-top: 14px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-list li {
    font-size: 18px;
    color: #e2e8f0;
    position: relative;
    padding-left: 20px;
    border-bottom: 1px dashed rgba(255,255,255,0.03);
    padding-bottom: 6px;
}

.detail-list li::before {
    content: '▶';
    position: absolute;
    left: 0;
    top: 3px;
    font-size: 10px;
    color: var(--primary);
}

/* Modals / Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeInModal 0.25s ease-out forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    box-shadow: 0 20px 60px rgba(255, 30, 39, 0.15);
    overflow: hidden;
    animation: slideUpModal 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    position: relative;
}

.modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
}

@keyframes slideUpModal {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-family: var(--font-hud);
    font-size: 18px;
    color: white;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--primary);
}

.modal-body {
    padding: 24px;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.modal-info-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 12px 14px;
    border-radius: var(--radius-md);
}

.modal-info-label {
    font-family: var(--font-hud);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.modal-info-value {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 30, 39, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 30, 39, 0.4);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .grid-2col, .roe-grid {
        grid-template-columns: 1fr;
    }
}
