/* ========================================
   OPERATIONS & CAMPAIGNS MODULE
   Estilos dedicados para la visualización de operaciones
   ======================================== */

:root {
    --op-primary: #667eea;
    --op-secondary: #764ba2;
    --op-accent: #f59e0b; /* Amber 500 */
    --op-success: #10b981; /* Emerald 500 */
    --op-danger: #ef4444; /* Red 500 */
    --op-bg-card: rgba(30, 41, 59, 0.7); 
    --op-border: rgba(255, 255, 255, 0.1);
    --op-text-muted: #94a3b8;
    --op-font-display: 'Horizon', sans-serif;
    --op-font-body: 'Oswald', sans-serif;
}

body, .op-detail-page {
    font-family: var(--op-font-body);
}

/* Base style for Footer to match main site */
/* NOTE: Footer styles are inherited from common.css */


/* --- HERO SECTION --- */
.hero.op-hero {
    position: relative;
    /* Create stacking context so negative z-index children stay within this section */
    isolation: isolate; 
    height: 35vh; /* Smaller than squadrons (50vh) */
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 60px;
}

.video-bg-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.video-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    background: linear-gradient(to bottom, rgba(15, 23, 46, 0.3), rgba(15, 23, 46, 0.95));
    z-index: 1;
}

.hero-content.center-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title-large {
    font-family: var(--op-font-display);
    font-size: 3rem;
    color: white;
    margin: 10px 0;
    text-shadow: 0 4px 20px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

.hero-subtitle {
    font-family: var(--op-font-body);
    font-size: 1.2rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.op-hero-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.op-badge-status {
    background: var(--op-accent);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
}

.op-badge-campaign {
    border: 1px solid rgba(255,255,255,0.3);
    color: #cbd5e1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.op-hero-meta-grid {
    display: inline-flex;
    gap: 30px;
    margin-top: 20px;
    padding: 10px 25px;
    background: rgba(255,255,255,0.05);
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
}

/* --- CONTENT SECTIONS --- */
.op-detail-page {
    padding-top: 0; /* Override old padding */
    background: #0f172e;
}

.content-stack {
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding-bottom: 30px;
    max-width: 1100px;
}

.op-section {
    position: relative;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.section-title {
    font-family: var(--op-font-display);
    font-size: 1.8rem;
    color: white;
    white-space: nowrap;
}

.section-line {
    height: 1px;
    background: rgba(255,255,255,0.1);
    flex-grow: 1;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .grid-2-col { grid-template-columns: 1fr; }
    .hero-title-large { font-size: 2rem; }
    .meta-item { font-size: 0.8rem; }
}

.subsection-title {
    font-family: var(--op-font-body);
    font-size: 1.2rem;
    color: var(--op-text-muted);
    border-bottom: 1px solid var(--op-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* --- BRIEFING OVERRIDE --- */
/* Override brightness for brief content to fit dark theme better if needed, 
   but user might want the 'paper' look. Let's make it slightly off-white 
   or light gray to not blind the user */
.briefing-content {
    background: #f1f5f9; /* Slate 100 */
    color: #1e293b;
    padding: 40px;
    border-radius: 4px;
    line-height: 1.7;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}


/* --- PREVIEW CARD (INDEX) [Kept from before] --- */
.op-preview-section {
    padding: 60px 0;
    background: linear-gradient(to bottom, var(--bandits-bg-1, #0f172e), #0b1120);
    color: #fff;
    overflow: hidden; 
}
/* ... keeping rest of preview styles ... */
/* Fondo decorativo táctico */
.op-preview-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 40%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.01) 0, rgba(255,255,255,0.01) 1px, transparent 1px, transparent 10px);
    z-index: 0;
    pointer-events: none;
}

.op-card-preview {
    background: var(--op-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--op-border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
}

@media (max-width: 900px) {
    .op-card-preview { grid-template-columns: 1fr; }
}

.op-card-info {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.op-card-map-vis {
    position: relative;
    min-height: 250px;
    background-size: cover;
    background-position: center;
    background-color: #1e293b;
    border-left: 1px solid var(--op-border);
}
.op-card-preview {
    margin-top: 20px;
}

.op-campaign-title {
    font-family: var(--op-font-body);
    font-size: 14px;
    color: var(--op-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    display: block;
}

.op-title {
    font-family: var(--op-font-display);
    font-size: 32px;
    line-height: 1.1;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.op-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.op-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.op-meta-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid rgba(255,255,255,0.1);
}

.op-meta-text {
    display: flex;
    flex-direction: column;
}

.op-meta-label {
    font-size: 11px;
    color: var(--op-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.op-meta-value {
    font-size: 15px;
    font-weight: 600;
    color: #f1f5f9;
}

.op-countdown-box {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 25px;
}

.op-timer {
    font-family: 'Horizon', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--op-primary);
    letter-spacing: 1px;
}

.op-actions {
    margin-top: auto;
}

/* ROSTER STYLES (Reused) */
.roster-container {
    max-width: 100%; /* Adapts to container */
}

/* UNASSIGNED GRID */
.unassigned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.unassigned-card {
    background: #0f172e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.unassigned-card-name {
    font-family: var(--op-font-display);
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.unassigned-card-ac {
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    color: #60a5fa; /* Blue accent */
    display: flex;
    align-items: center;
    gap: 6px;
}

.squadron-block {
    background: var(--op-bg-card);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--op-border);
}

.squadron-header {
    background: rgba(255,255,255,0.03);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--op-border);
}

.squadron-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.flight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px;
}

.flight-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--op-border);
    border-radius: 6px;
    padding: 15px;
}

.flight-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.flight-name {
    font-weight: bold;
    color: var(--op-primary);
}

.flight-ac {
    font-size: 12px;
    background: #334155;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e2e8f0;
}

.slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
}

.slot-item.vacant {
    border-left: 3px solid var(--op-danger);
}
.slot-item.occupied {
    border-left: 3px solid var(--op-success);
}

.slot-pos {
    color: var(--op-text-muted);
}
.slot-pilot {
    font-weight: 600;
    color: white;
}
.slot-pilot.vacant-text {
    color: var(--op-text-muted);
    font-style: italic;
    opacity: 0.6;
}

/* User/Pilot Link Styles used when pilot is an object */
.slot-pilot-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    transition: background 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
}
.slot-pilot-link:hover {
    background: rgba(255,255,255,0.1);
}
.slot-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px; /* Prevent squishing */
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
    display: block;
}
.slot-pilot-name {
    font-weight: 600;
}

/* --- MISSION TAB NAVIGATION --- */
.mission-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--op-border);
    margin-bottom: 40px;
    margin-top: -20px;
    /* overflow-x: auto;  REMOVED: Caused vertical scrollbar on some browsers/layouts because of scrollbar height */
    -webkit-overflow-scrolling: touch;
    flex-wrap: wrap; /* ADDED: Wrap tabs if they exceed width, safer than scroll */
}

.mission-tab {
    padding: 14px 24px;
    background: none;
    border: none;
    color: var(--op-text-muted);
    font-family: var(--op-font-body);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mission-tab:hover {
    color: #fff;
}

.mission-tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.mission-tab i {
    font-size: 0.85em;
}

.mission-tab-content {
    display: none;
}

.mission-tab-content.active {
    display: block;
}

/* --- MISSION DATA TAB --- */
.mission-data-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.mission-hero-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--op-border);
    max-height: 400px;
}

.mission-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mission-info-card {
    background: var(--op-bg-card);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--op-border);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-size: 0.8rem;
    color: var(--op-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-label i {
    color: #60a5fa;
    width: 14px;
    text-align: center;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
}

/* --- BRIEFING PANEL --- */
.briefing-panel {
    background: rgba(15, 23, 46, 0.6);
    border: 1px solid var(--op-border);
    border-radius: 12px;
    padding: 30px 35px;
    color: #e2e8f0;
    line-height: 1.8;
    font-size: 0.95rem;
}

.briefing-panel h1,
.briefing-panel h2,
.briefing-panel h3,
.briefing-panel h4 {
    color: #fff;
    font-family: var(--op-font-body);
    margin-top: 25px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 8px;
}

.briefing-panel h3 {
    color: #60a5fa;
    font-size: 1.15em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.briefing-panel p {
    margin-bottom: 12px;
    color: #cbd5e1;
}

.briefing-panel ul,
.briefing-panel ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.briefing-panel li {
    margin-bottom: 6px;
    color: #cbd5e1;
}

.briefing-panel strong {
    color: #f1f5f9;
}

.briefing-panel img {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid var(--op-border);
}

.briefing-panel a {
    color: #60a5fa;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .mission-tabs {
        gap: 0;
    }
    .mission-tab {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
    .briefing-panel {
        padding: 20px;
    }
}
