/* ============================================
   International Law Page - Dedicated Styles
   Page Accent: #4a148c (Purple)
   ============================================ */

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

/* History Header */
.history-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 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: #ce93d8;
    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: #ce93d8;
}

/* 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(74, 20, 140, 0.08);
    color: #4a148c;
    border-left-color: #4a148c;
    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 #4a148c;
}

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

.era-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: #4a148c;
    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;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #4a148c;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 46%;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.timeline-item:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
}

.timeline-item:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
}

/* Timeline connector dots */
.timeline-item::after {
    content: '';
    position: absolute;
    top: 1.25rem;
    width: 14px;
    height: 14px;
    background: #4a148c;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #4a148c;
    z-index: 1;
}

.timeline-item:nth-child(odd)::after {
    right: -7%;
    transform: translateX(50%);
}

.timeline-item:nth-child(even)::after {
    left: -7%;
    transform: translateX(-50%);
}

/* Timeline connector lines */
.timeline-item::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    width: 4%;
    height: 2px;
    background: #4a148c;
}

.timeline-item:nth-child(odd)::before {
    right: -4%;
}

.timeline-item:nth-child(even)::before {
    left: -4%;
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4a148c;
    margin-bottom: 0.3rem;
}

.timeline-item h4 {
    font-size: 0.95rem;
    color: #1a1a2e;
    margin-bottom: 0.4rem;
}

.timeline-item p {
    font-size: 0.88rem;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* Transformation Visual (2-column comparisons) */
.transformation-visual {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
    margin: 1.5rem 0;
}

.transform-panel {
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.transform-panel h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.transform-panel ul {
    list-style: none;
    padding: 0;
    text-align: left;
    font-size: 0.88rem;
}

.transform-panel ul li {
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.transform-panel ul li::before {
    content: '>';
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #666;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.data-table th {
    background: #1a1a2e;
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}

.data-table tr:hover td {
    background: #f8f9fa;
}

/* Sources Section */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.source-category h4 {
    font-size: 0.9rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #4a148c;
}

.source-category ul {
    list-style: none;
    padding: 0;
}

.source-category ul li {
    font-size: 0.82rem;
    color: #555;
    padding: 0.3rem 0;
}

.source-category ul li a {
    color: #0f3460;
    text-decoration: none;
}

.source-category ul li a:hover {
    color: #4a148c;
    text-decoration: underline;
}

/* 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: #ce93d8;
    text-decoration: none;
}

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

/* 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.info a {
    color: #0d47a1;
    text-decoration: underline;
}

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

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

/* ============================================
   Page-Specific Components
   ============================================ */

/* Institution Cards */
.institutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.institution-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e9ecef;
    border-top: 4px solid #4a148c;
    transition: all 0.3s ease;
}

.institution-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.institution-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a148c, #7b1fa2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 0.75rem;
}

.institution-card h4 {
    font-size: 0.95rem;
    color: #1a1a2e;
    margin-bottom: 0.3rem;
}

.institution-card .jurisdiction {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}

.institution-card .est-year {
    font-size: 0.75rem;
    color: #4a148c;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.resolved {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.pending {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.provisional {
    background: #ffebee;
    color: #c62828;
}

.status-badge.issued {
    background: #fce4ec;
    color: #880e4f;
}

/* Legal Comparison (2 columns) */
.legal-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.legal-panel {
    padding: 1.5rem;
    border-radius: 10px;
}

.legal-panel.prosecution {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border: 2px solid #c62828;
}

.legal-panel.defense {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #1565c0;
}

.legal-panel h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.legal-panel.prosecution h4 {
    color: #c62828;
}

.legal-panel.defense h4 {
    color: #1565c0;
}

.legal-panel ul {
    list-style: none;
    padding: 0;
}

.legal-panel ul li {
    padding: 0.3rem 0 0.3rem 1.2rem;
    position: relative;
    font-size: 0.88rem;
}

.legal-panel ul li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    font-weight: 700;
}

.legal-panel.prosecution ul li::before {
    color: #c62828;
}

.legal-panel.defense ul li::before {
    color: #1565c0;
}

/* Legal Positions (3 columns) */
.legal-positions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.position-panel {
    padding: 1.5rem;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-top: 4px solid;
}

.position-panel.israel-pos {
    border-top-color: #1565c0;
}

.position-panel.iran-pos {
    border-top-color: #2e7d32;
}

.position-panel.palestine-pos {
    border-top-color: #f57c00;
}

.position-panel h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.position-panel.israel-pos h4 {
    color: #1565c0;
}

.position-panel.iran-pos h4 {
    color: #2e7d32;
}

.position-panel.palestine-pos h4 {
    color: #f57c00;
}

.position-panel ul {
    list-style: none;
    padding: 0;
}

.position-panel ul li {
    padding: 0.4rem 0;
    font-size: 0.88rem;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.5;
}

.position-panel ul li:last-child {
    border-bottom: none;
}

/* Vote cells for tables */
.vote-yes {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
    text-align: center;
}

.vote-no {
    background: #ffebee;
    color: #c62828;
    font-weight: 600;
    text-align: center;
}

.vote-abstain {
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
    text-align: center;
}

.vote-veto {
    background: #fce4ec;
    color: #880e4f;
    font-weight: 700;
    text-align: center;
}

/* Badge for ICC timeline */
.badge-issued {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    background: #ffebee;
    color: #c62828;
    font-weight: 600;
}

.badge-pending {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    background: #fff3e0;
    color: #e65100;
    font-weight: 600;
}

.badge-executed {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
}

/* ============================================
   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;
    }

    /* Timeline single column */
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: calc(100% - 50px);
        margin-left: 50px !important;
        margin-right: 0 !important;
    }

    .timeline-item::after {
        left: -35px !important;
        right: auto !important;
        transform: none !important;
    }

    .timeline-item::before {
        left: -20px !important;
        right: auto !important;
        width: 15px;
    }

    /* Legal comparison stacks */
    .legal-comparison {
        grid-template-columns: 1fr;
    }

    /* Legal positions stacks */
    .legal-positions {
        grid-template-columns: 1fr;
    }

    /* Institutions grid 2 cols */
    .institutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Transformation visual stacks */
    .transformation-visual {
        grid-template-columns: 1fr !important;
    }

    /* Sources */
    .sources-grid {
        grid-template-columns: 1fr;
    }

    /* Era section */
    .era-header {
        padding: 1rem;
    }

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

@media (max-width: 480px) {
    .history-header h1 {
        font-size: 1.3rem;
    }

    .history-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Institutions grid 1 col */
    .institutions-grid {
        grid-template-columns: 1fr;
    }

    .era-header h2 {
        font-size: 1rem;
    }

    .era-header .era-dates {
        display: none;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}