/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

body.dragging {
    cursor: grabbing;
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 20px;
    z-index: 100;
    position: relative;
}

.main-title {
    font-family: 'Bangers', cursive;
    font-size: 4rem;
    color: #fff;
    text-shadow: 
        4px 4px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        1px 1px 0px #000,
        0px 0px 20px rgba(255, 255, 255, 0.5);
    letter-spacing: 8px;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 4px 4px 0px #000, -1px -1px 0px #000, 1px -1px 0px #000, -1px 1px 0px #000, 1px 1px 0px #000, 0px 0px 20px rgba(255, 255, 255, 0.5); }
    to { text-shadow: 4px 4px 0px #000, -1px -1px 0px #000, 1px -1px 0px #000, -1px 1px 0px #000, 1px 1px 0px #000, 0px 0px 30px rgba(255, 255, 255, 0.8); }
}

.subtitle {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    font-weight: 700;
}

/* Timeline Container */
.timeline-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 50px;
    overflow: hidden;
}

/* Timeline Sections */
.timeline-section {
    height: 150px;
    position: relative;
    display: flex;
    align-items: center;
}

.top-timeline {
    margin-bottom: 20px;
}

.bottom-timeline {
    margin-top: 20px;
}

/* Timeline Labels */
.timeline-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 
        3px 3px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        1px 1px 0px #000;
    letter-spacing: 4px;
    pointer-events: none;
}

.right-label {
    top: 50%;
    transform: translate(-50%, -50%);
}

.left-label {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Timeline Tracks */
.timeline-track {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: visible;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fff 0%, #f0f0f0 50%, #fff 100%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
}

.timeline-content {
    position: relative;
    height: 200px; /* Increased height to accommodate stacked entries */
    overflow: visible;
}

/* Separator Section */
.separator-section {
    height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.separator-line {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, 
        #ff0000 0%, #ff0000 33%, 
        #ffffff 33%, #ffffff 66%, 
        #0000ff 66%, #0000ff 100%);
    position: relative;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.5),
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(0, 0, 255, 0.5);
    animation: patrioticGlow 3s ease-in-out infinite alternate;
}

@keyframes patrioticGlow {
    from { 
        box-shadow: 
            0 0 20px rgba(255, 0, 0, 0.5),
            0 0 20px rgba(255, 255, 255, 0.5),
            0 0 20px rgba(0, 0, 255, 0.5);
    }
    to { 
        box-shadow: 
            0 0 30px rgba(255, 0, 0, 0.8),
            0 0 30px rgba(255, 255, 255, 0.8),
            0 0 30px rgba(0, 0, 255, 0.8);
    }
}

.vs-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: #fff;
    background: radial-gradient(circle, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
    padding: 10px 20px;
    border-radius: 50%;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        1px 1px 0px #000;
    letter-spacing: 2px;
}

/* Timeline Entries */
.timeline-entry {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border: 3px solid #fff;
    box-shadow: 
        0 0 15px rgba(255, 215, 0, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    z-index: 10;
}

.timeline-entry:hover {
    transform: translateY(-50%) scale(1.5);
    box-shadow: 
        0 0 25px rgba(255, 215, 0, 1),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
}

.timeline-entry.right-entry {
    top: 50%;
}

.timeline-entry.left-entry {
    top: 50%;
}

.timeline-entry .entry-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

/* Violent Entry Styling */
.timeline-entry.violent-entry {
    border: 3px solid #ff4444;
    box-shadow: 
        0 0 20px rgba(255, 68, 68, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: violentPulse 2s ease-in-out infinite alternate;
}

.timeline-entry.violent-entry:hover {
    transform: translateY(-50%) scale(1.5);
    box-shadow: 
        0 0 30px rgba(255, 68, 68, 1),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
}

@keyframes violentPulse {
    from { 
        box-shadow: 
            0 0 20px rgba(255, 68, 68, 0.8),
            inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    to { 
        box-shadow: 
            0 0 25px rgba(255, 68, 68, 1),
            inset 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

.bomb-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ff4444;
    z-index: 15;
}

/* Racist Entry Styling */
.timeline-entry.racist-entry {
    border: 3px solid #8B4513;
    box-shadow: 
        0 0 20px rgba(139, 69, 19, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: racistPulse 2s ease-in-out infinite alternate;
}

.timeline-entry.racist-entry:hover {
    transform: translateY(-50%) scale(1.5);
    box-shadow: 
        0 0 30px rgba(139, 69, 19, 1),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
}

@keyframes racistPulse {
    from { 
        box-shadow: 
            0 0 20px rgba(139, 69, 19, 0.8),
            inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    to { 
        box-shadow: 
            0 0 25px rgba(139, 69, 19, 1),
            inset 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

.mask-icon {
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8B4513;
    z-index: 15;
}

/* Unrest Entry Styling */
.timeline-entry.unrest-entry {
    border: 3px solid #FF8C00;
    box-shadow: 
        0 0 20px rgba(255, 140, 0, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: unrestPulse 2s ease-in-out infinite alternate;
}

.timeline-entry.unrest-entry:hover {
    transform: translateY(-50%) scale(1.5);
    box-shadow: 
        0 0 30px rgba(255, 140, 0, 1),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
}

@keyframes unrestPulse {
    from { 
        box-shadow: 
            0 0 20px rgba(255, 140, 0, 0.8),
            inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    to { 
        box-shadow: 
            0 0 25px rgba(255, 140, 0, 1),
            inset 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

.unrest-icon {
    position: absolute;
    bottom: -8px;
    right: -8px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #FF8C00;
    z-index: 15;
}

/* Far-Right Entry Styling */
.timeline-entry.farright-entry {
    border: 3px solid #8B0000;
    box-shadow: 
        0 0 20px rgba(139, 0, 0, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: farrightPulse 2s ease-in-out infinite alternate;
}

.timeline-entry.farright-entry:hover {
    transform: translateY(-50%) scale(1.5);
    box-shadow: 
        0 0 30px rgba(139, 0, 0, 1),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
}

@keyframes farrightPulse {
    from { 
        box-shadow: 
            0 0 20px rgba(139, 0, 0, 0.8),
            inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    to { 
        box-shadow: 
            0 0 25px rgba(139, 0, 0, 1),
            inset 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

.farright-icon {
    position: absolute;
    bottom: -8px;
    left: -8px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8B0000;
    z-index: 15;
}

/* Trans Nihilistic Entry Styling */
.timeline-entry.transnihilistic-entry {
    border: 3px solid #9932CC;
    box-shadow: 
        0 0 20px rgba(153, 50, 204, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: transnihilisticPulse 2s ease-in-out infinite alternate;
}

.timeline-entry.transnihilistic-entry:hover {
    transform: translateY(-50%) scale(1.5);
    box-shadow: 
        0 0 30px rgba(153, 50, 204, 1),
        inset 0 0 15px rgba(255, 255, 255, 0.5);
}

@keyframes transnihilisticPulse {
    from { 
        box-shadow: 
            0 0 20px rgba(153, 50, 204, 0.8),
            inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    to { 
        box-shadow: 
            0 0 25px rgba(153, 50, 204, 1),
            inset 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

.transnihilistic-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #9932CC;
    z-index: 15;
}

/* Year Scale */
.year-scale {
    position: absolute;
    bottom: 20px;
    left: 0;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 50px;
    overflow: visible;
    z-index: 5;
}

.year-marker {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transform: translateX(-50%);
    z-index: 10;
}

.year-tick {
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, #fff 0%, #ffd700 100%);
    margin-bottom: 8px;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    border-radius: 2px;
}

.year-label {
    font-size: 1.1rem;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    max-width: 300px;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-content {
    text-align: center;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 4px solid #fff;
    box-shadow: 
        0 0 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 3px solid #fff;
    padding-bottom: 15px;
}

.modal-title {
    font-family: 'Bangers', cursive;
    font-size: 2rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    color: #fff;
}

.modal-year {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.modal-side {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding: 5px 15px;
    border-radius: 15px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-side.right {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: #fff;
}

.modal-side.left {
    background: linear-gradient(45deg, #4834d4, #686de0);
    color: #fff;
}

.modal-text {
    font-size: 1.1rem;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Control Panel */
.control-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    min-width: 250px;
    z-index: 100;
}

.control-panel h3 {
    font-family: 'Bangers', cursive;
    font-size: 1.3rem;
    color: #ffd700;
    margin: 0 0 10px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
}

.jump-to-year {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ffd700;
}

.jump-to-year input {
    width: 120px;
    padding: 8px 10px;
    margin-right: 10px;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.jump-to-year input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.jump-to-year input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.jump-to-year button {
    padding: 8px 15px;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.jump-to-year button:hover {
    background: linear-gradient(45deg, #ffed4e, #fff);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    transform: translateY(-1px);
}

.legend {
    margin-top: 15px;
}

.legend-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
}

.legend-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.legend-indicator.right {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.legend-indicator.left {
    background: linear-gradient(45deg, #4834d4, #686de0);
}

.legend-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-item.violent {
    border: 1px solid #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.legend-item.violent:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff6666;
}

.legend-item.racist {
    border: 1px solid #8B4513;
    background: rgba(139, 69, 19, 0.1);
}

.legend-item.racist:hover {
    background: rgba(139, 69, 19, 0.2);
    border-color: #A0522D;
}

.legend-item.unrest {
    border: 1px solid #FF8C00;
    background: rgba(255, 140, 0, 0.1);
}

.legend-item.unrest:hover {
    background: rgba(255, 140, 0, 0.2);
    border-color: #FFA500;
}

.legend-item.farright {
    border: 1px solid #8B0000;
    background: rgba(139, 0, 0, 0.1);
}

.legend-item.farright:hover {
    background: rgba(139, 0, 0, 0.2);
    border-color: #DC143C;
}

.legend-item.transnihilistic {
    border: 1px solid #9932CC;
    background: rgba(153, 50, 204, 0.1);
}

.legend-item.transnihilistic:hover {
    background: rgba(153, 50, 204, 0.2);
    border-color: #BA55D3;
}

.legend-label {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-count {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid #ffd700;
}

/* Instructions */
.instructions {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .timeline-label {
        font-size: 1.8rem;
    }
    
    .vs-text {
        font-size: 1.5rem;
        padding: 8px 16px;
    }
    
    .control-panel {
        position: relative;
        top: 10px;
        left: 10px;
        right: 10px;
        margin-bottom: 20px;
        min-width: auto;
        width: calc(100% - 20px);
    }
    
    .jump-to-year input {
        width: 100px;
        margin-bottom: 10px;
    }
    
    .jump-to-year button {
        width: 60px;
    }
    
    .instructions {
        position: relative;
        margin: 10px;
        text-align: center;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
}
