/* ============================================
   Intelligence & Cyber Warfare - Dedicated Styles
   Accent: #1a1a2e (dark navy), #e94560 (red)
   ============================================ */

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #1a1a2e, #e94560);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* History Header */
.history-header {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
    color: white;
    padding: 3rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.history-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.history-header .container {
    position: relative;
    z-index: 1;
}

.history-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.history-header h1 i {
    color: #e94560;
    margin-right: 0.5rem;
}

.history-header .subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    margin-bottom: 1rem;
}

.history-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.history-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.history-meta i {
    color: #e94560;
}

/* Layout: Sidebar + Content */
.history-layout {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* Table of Contents - Sidebar */
.toc-nav {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.toc-nav h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.25rem;
}

.toc-list a {
    display: block;
    padding: 0.4rem 0.75rem;
    color: #555;
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    line-height: 1.4;
}

.toc-list a:hover {
    background: #f8f9fa;
    color: #1a1a2e;
}

.toc-list a.active {
    background: rgba(233, 69, 96, 0.08);
    color: #e94560;
    border-left-color: #e94560;
    font-weight: 600;
}

/* Mobile TOC Toggle */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1a1a2e;
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
}

/* Main Content Area */
.history-content {
    flex: 1;
    min-width: 0;
}

/* Era Sections */
.era-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.era-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    border-left: 5px solid #1a1a2e;
}

.era-header:hover {
    background: #fafafa;
}

.era-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: #1a1a2e;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.era-header h2 {
    flex: 1;
    font-size: 1.15rem;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.era-header .era-dates {
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
}

.era-toggle {
    font-size: 1rem;
    color: #999;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.era-section.open .era-toggle {
    transform: rotate(180deg);
}

.era-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.era-section.open .era-content {
    max-height: none;
}

.era-body {
    padding: 0 1.5rem 1.5rem;
    line-height: 1.8;
    color: #444;
    text-align: justify;
}

.era-body p {
    margin-bottom: 1rem;
}

.era-body h3 {
    font-size: 1.05rem;
    color: #1a1a2e;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #f0f0f0;
}

/* Callout boxes */
.callout {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.callout.info {
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
    color: #1565c0;
}

.callout.warning {
    background: #fff3e0;
    border-left: 4px solid #f57c00;
    color: #e65100;
}

.callout.key-fact {
    background: #f3e5f5;
    border-left: 4px solid #7b1fa2;
    color: #4a148c;
}

/* History Footer */
.history-footer {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.history-footer p {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.history-footer a {
    color: #e94560;
    text-decoration: none;
}

.history-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   PAGE-SPECIFIC: Intelligence Components
   ============================================ */

/* Agency Cards */
.agency-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.agency-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.agency-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.agency-card-header .agency-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.agency-icon.israeli { background: #e3f2fd; color: #0d47a1; }
.agency-icon.iranian { background: #e8f5e9; color: #1b5e20; }
.agency-icon.us { background: #fce4ec; color: #b71c1c; }

.agency-card-header h4 {
    font-size: 1.05rem;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.agency-card-header .agency-type {
    font-size: 0.75rem;
    color: #999;
    font-weight: 400;
    display: block;
}

.agency-card p {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.agency-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.agency-detail {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #1a1a2e;
}

.agency-detail .detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    font-weight: 600;
}

.agency-detail .detail-value {
    font-size: 0.85rem;
    color: #1a1a2e;
    font-weight: 600;
}

.agency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

/* Operation Cards */
.operation-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    border-left: 4px solid #e94560;
    transition: box-shadow 0.2s ease;
}

.operation-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.operation-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.operation-card-header h4 {
    font-size: 1rem;
    color: #1a1a2e;
    margin: 0;
}

.operation-date {
    font-size: 0.78rem;
    color: #e94560;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(233, 69, 96, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.operation-card p {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.operation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.operation-tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.operation-tag.target { background: #fff3e0; color: #e65100; }
.operation-tag.method { background: #e3f2fd; color: #0d47a1; }
.operation-tag.attribution { background: #f3e5f5; color: #6a1b9a; }
.operation-tag.consequence { background: #fce4ec; color: #c62828; }

/* Classified Badge */
.classified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}

.classified-badge.classified {
    background: #1a1a2e;
    color: #e94560;
    border: 1px solid #e94560;
}

.classified-badge.declassified {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.classified-badge.attributed {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

/* Cyber Card (terminal style) */
.cyber-card {
    background: #0d1117;
    border-radius: 10px;
    border: 1px solid #30363d;
    padding: 1.25rem;
    margin-bottom: 1rem;
    font-family: 'Courier New', Consolas, monospace;
    position: relative;
    overflow: hidden;
}

.cyber-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e94560, #00ff41, #e94560);
}

.cyber-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.cyber-card-header .cyber-icon { color: #00ff41; font-size: 1.2rem; }
.cyber-card-header h4 { color: #00ff41; font-size: 0.95rem; margin: 0; font-family: 'Courier New', Consolas, monospace; }
.cyber-card-header .cyber-year { color: #e94560; font-size: 0.78rem; font-weight: 700; }

.cyber-card p { color: #8b949e; font-size: 0.85rem; line-height: 1.6; margin-bottom: 0.5rem; }
.cyber-card .cyber-detail { color: #58a6ff; font-size: 0.82rem; }
.cyber-card .prompt { color: #00ff41; }
.cyber-card .highlight { color: #ff7b72; }

.cyber-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

/* Intel Category Header */
.intel-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.intel-category i { color: #e94560; font-size: 1.1rem; }

.intel-category h3 {
    font-size: 1.05rem;
    color: #1a1a2e;
    margin: 0;
    border: none;
    padding: 0;
}

/* Stats Banner */
.stats-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 8px;
}

.stat-item .stat-number { font-size: 1.5rem; font-weight: 800; color: #1a1a2e; display: block; }
.stat-item .stat-label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 1200px) {
    .toc-nav { width: 220px; }
}

@media (max-width: 768px) {
    .history-header h1 { font-size: 1.6rem; }
    .history-header .subtitle { font-size: 0.95rem; }

    .history-layout { flex-direction: column; }

    .toc-nav {
        display: none;
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 260px;
        max-height: 60vh;
        z-index: 499;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    }

    .toc-nav.mobile-open { display: block; }
    .toc-mobile-toggle { display: flex; }

    .era-header { padding: 1rem; }
    .era-body { padding: 0 1rem 1rem; }

    .agency-grid, .cyber-grid { grid-template-columns: 1fr; }
    .agency-details { grid-template-columns: 1fr 1fr; }

    .operation-card-header { flex-direction: column; gap: 0.3rem; }
    .stats-banner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .history-header h1 { font-size: 1.3rem; }
    .history-meta { flex-direction: column; gap: 0.5rem; }
    .era-header h2 { font-size: 1rem; }
    .era-header .era-dates { display: none; }

    .agency-details { grid-template-columns: 1fr; }
    .stats-banner { grid-template-columns: 1fr; }
}
