/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: auto;
    overflow-y: visible;
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 50%, #0D47A1 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Setup Panel */
.setup-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.setup-content h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.setup-instructions {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 0 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(33, 150, 243, 0.2);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Improve button hover states */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    width: 100%;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    position: relative;
    z-index: 1;
}

.btn-primary > * {
    position: relative;
    z-index: 2;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
    background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    color: #1976D2;
    border: 2px solid rgba(33, 150, 243, 0.2);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #2196F3;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

/* Special styling for backup/import buttons */
.btn-secondary[onclick="exportData()"],
.btn-secondary[onclick="importData()"] {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.btn-secondary[onclick="exportData()"]:hover,
.btn-secondary[onclick="importData()"]:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #388E3C;
}

/* Special styling for "On This Day" button */
.btn-special {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.3);
}

.btn-special:hover {
    background: linear-gradient(135deg, #FB8C00 0%, #EF6C00 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

/* Timeline Container */
.timeline-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: visible; /* Allow event cards to overflow */
    position: relative;
    z-index: 1;
    min-height: 300px; /* Reduced minimum height */
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.timeline-info h2 {
    color: #333;
    font-weight: 600;
}

.timeline-info p {
    color: #666;
    margin-top: 5px;
}

.timeline-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.timeline-toggles {
    display: flex;
    gap: 5px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
}

.btn-toggle {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    color: #1976D2;
    border: 1px solid rgba(33, 150, 243, 0.2);
    font-weight: 500;
}

.btn-toggle:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: none;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.btn-toggle.active {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border-color: #2196F3;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.4);
}

.btn-toggle.active:hover {
    background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
}

/* Add focus styles for accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #2196F3;
    outline-offset: 2px;
}

/* Timeline Wrapper - Rebuilt */
.timeline-wrapper {
    position: relative;
    height: 450px;
    overflow: hidden; /* Changed from visible to hidden */
    border: 2px solid #e1e5e9;
    background: #ffffff;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
    margin: 0;
}

.timeline-scroll {
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden; /* Changed from visible to hidden to prevent vertical scrollbar */
    padding: 80px 0 80px 0; /* Equal padding top and bottom for flexibility */
    position: relative;
}

.timeline {
    position: relative;
    height: 100%;
    min-width: 100%;
    display: flex;
    align-items: center;
    padding: 0 50px;
    overflow: visible; /* Allow events to overflow */
    min-height: 150px; /* Reduced minimum height */
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 50px;
    right: 50px;
    height: 4px;
    background: linear-gradient(90deg, #2196F3 0%, #1976D2 50%, #1565C0 100%);
    border-radius: 2px;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    z-index: 1;
}

.timeline-events {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: visible;
}

.timeline-years {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Timeline Years - Rebuilt */
.year-marker {
    position: absolute;
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-align: center;
    transform: translateX(-50%);
    user-select: none;
    pointer-events: none;
}

.year-marker.top {
    top: 20px;
}

.year-marker.bottom {
    bottom: 20px;
}

.year-marker.major {
    font-size: 12px;
    font-weight: 600;
    color: #1976D2;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid rgba(33, 150, 243, 0.2);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    backdrop-filter: blur(10px);
}

.year-marker.major::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 20px;
    background: rgba(33, 150, 243, 0.4);
}

.year-marker.major.top::after {
    top: 100%;
    margin-top: 2px;
}

.year-marker.major.bottom::after {
    bottom: 100%;
    margin-bottom: 2px;
}

/* Hide minor year markers on smaller zoom levels */
@media (max-width: 768px) {
    .year-marker:not(.major) {
        display: none;
    }
}

/* Timeline Events - Unified Structure */
.timeline-event {
    position: absolute;
    top: 50%;
    cursor: pointer;
    transform: translateX(-50%) translateY(-50%);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10;
    pointer-events: auto;
}

/* Birth events get slightly higher z-index */
.timeline-event[data-event-type="birth"] {
    z-index: 15;
}

/* Ultra-fine continuous dock effect - pixel-perfect Mac-like scaling */
.timeline-event.dock-continuous {
    z-index: 50;
    transition: all 0.1s cubic-bezier(0.23, 1, 0.32, 1); /* Ultra-smooth easing */
    transform: translateX(-50%) translateY(-50%) scale(var(--dock-scale, 1));
}

.timeline-event.dock-continuous .event-marker {
    width: var(--dock-marker-width, 4px);
    height: var(--dock-marker-height, 32px);
    border-radius: var(--dock-marker-radius, 2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); /* Standard shadow, no variables */
    transition: all 0.1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Primary hover effect for the main hovered event */
.timeline-event:hover {
    z-index: 100;
    transform: translateX(-50%) translateY(-50%) scale(1.7); /* Balanced primary scale */
}

.timeline-event:hover .event-marker {
    width: 8px;
    height: 58px;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25); /* More subtle shadow */
}

/* Legacy dock levels - kept for fallback but with reduced importance */
.timeline-event.dock-level-1,
.timeline-event.dock-level-2,
.timeline-event.dock-level-3,
.timeline-event.dock-level-4 {
    z-index: 50;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Use CSS custom property for ultra-smooth scaling */
.timeline-event[style*="--dock-scale"]:not(.dock-continuous) {
    transform: translateX(-50%) translateY(-50%) scale(var(--dock-scale, 1));
}

/* Dock Level 1 - Closest to hovered event (largest magnification) */
.timeline-event.dock-level-1 {
    transform: translateX(-50%) translateY(-50%) scale(1.25);
}

.timeline-event.dock-level-1 .event-marker {
    width: 5.5px;
    height: 44px;
    border-radius: 2.75px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* Dock Level 2 - Second closest */
.timeline-event.dock-level-2 {
    transform: translateX(-50%) translateY(-50%) scale(1.18);
}

.timeline-event.dock-level-2 .event-marker {
    width: 5px;
    height: 40px;
    border-radius: 2.5px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.22);
}

/* Dock Level 3 - Third closest */
.timeline-event.dock-level-3 {
    transform: translateX(-50%) translateY(-50%) scale(1.12);
}

.timeline-event.dock-level-3 .event-marker {
    width: 4.5px;
    height: 36px;
    border-radius: 2.25px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}

/* Dock Level 4 - Furthest affected (smallest magnification) */
.timeline-event.dock-level-4 {
    transform: translateX(-50%) translateY(-50%) scale(1.06);
}

.timeline-event.dock-level-4 .event-marker {
    width: 4.2px;
    height: 34px;
    border-radius: 2.1px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* Legacy adjacent-hover class for backward compatibility */
.timeline-event.adjacent-hover {
    z-index: 50;
    transform: translateX(-50%) translateY(-50%) scale(1.1);
    transition: all 0.3s ease;
}

.timeline-event.adjacent-hover .event-marker {
    width: 5px;
    height: 40px;
    border-radius: 2.5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Event markers - simplified and precise */
.event-marker {
    width: 4px;
    height: 32px;
    border-radius: 2px;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* Marker colors using data attributes */
.event-marker[data-event-type="personal"] {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.event-marker[data-event-type="historical"] {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.event-marker[data-event-type="birth"] {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    animation: pulse 2s infinite;
}

.event-connector {
    display: none;
}

.event-card {
    position: fixed; /* Changed from absolute to fixed for better positioning */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 16px;
    width: 250px;
    min-height: auto;
    max-width: 90vw; /* Responsive width */
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(33, 150, 243, 0.2);
    border: 2px solid rgba(33, 150, 243, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10000; /* Higher z-index to appear above everything */
    pointer-events: auto; /* Changed to auto so card can receive events */
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Remove individual positioning - we'll handle it in JavaScript */
.timeline-event[data-event-type="personal"] .event-card,
.timeline-event[data-event-type="historical"] .event-card,
.timeline-event[data-event-type="birth"] .event-card {
    /* Positioning will be handled dynamically via JavaScript */
}

.event-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word; /* Allow text to wrap */
    white-space: normal; /* Changed from nowrap */
    overflow: visible; /* Changed from hidden */
    font-family: 'Inter', sans-serif;
}

.event-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

.event-description {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
    word-wrap: break-word;
    white-space: normal;
}

/* Timeline Legend */
.timeline-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #666;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-color.personal {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.legend-color.historical {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.legend-color.birth {
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(33, 150, 243, 0.1);
    background: rgba(33, 150, 243, 0.05);
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(33, 150, 243, 0.1);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: rgba(33, 150, 243, 0.02);
    border-radius: 0 0 20px 20px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .setup-panel {
        padding: 30px 20px;
    }
    
    .setup-instructions {
        font-size: 0.85rem;
    }
    
    .timeline-container {
        padding: 20px 15px;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 15px;
    }
    
    .timeline-info h2 {
        font-size: 1.5rem;
    }
    
    .timeline-controls {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }
    
    .timeline-controls > .btn {
        width: 100%;
        justify-content: center;
    }
    
    .timeline-toggles {
        order: -1;
        align-self: stretch;
        justify-content: center;
    }
    
    .btn-toggle {
        padding: 8px 12px;
        font-size: 0.75rem;
        flex: 1;
    }
    
    .timeline-wrapper {
        height: 350px;
    }
    
    .timeline-legend {
        justify-content: center;
        gap: 15px;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
    
    .event-card {
        width: 160px;
        min-height: 70px;
        font-size: 0.7rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Scrollbar Styling */
.timeline-scroll::-webkit-scrollbar {
    height: 8px;
}

.timeline-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #2196F3 0%, #1976D2 100%);
    border-radius: 10px;
}

.timeline-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #1E88E5 0%, #1565C0 100%);
}

/* Add pulsing animation for birth event */
.timeline-event.birth .event-marker {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(233, 30, 99, 0.6);
    }
    100% {
        box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
    }
}

/* Enhance card appearance on hover - unified */
.timeline-event:hover .event-card {
    box-shadow: 0 12px 48px rgba(0,0,0,0.25);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Smooth zoom transitions */
.timeline-events {
    transition: all 0.3s ease;
}

/* On This Day Modal Styles */
.on-this-day-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.on-this-day-modal .modal-header h2 {
    color: #2196F3;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.on-this-day-events {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px 0;
}

.on-this-day-event {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #2196F3;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.on-this-day-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.on-this-day-event.personal {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 100%);
}

.on-this-day-event.historical {
    border-left-color: #ff9800;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.on-this-day-event.birth {
    border-left-color: #e91e63;
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.event-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    flex: 1;
    line-height: 1.3;
}

.event-years-ago {
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    background: rgba(255,255,255,0.7);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
    flex-wrap: wrap;
}

.event-category {
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
    background: rgba(33, 150, 243, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

.event-date {
    font-size: 0.8rem;
    color: #777;
    flex: 1;
    text-align: right;
}

.event-description {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.no-events {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

/* Responsive adjustments for On This Day modal */
@media (max-width: 768px) {
    .on-this-day-modal {
        max-width: 95vw;
        margin: 10px;
    }
    
    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .event-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .event-date {
        text-align: left;
    }
}
