* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.time-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.time-selector label {
    font-weight: 600;
    color: #555;
}

.time-selector input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    width: 120px;
    transition: border-color 0.3s ease;
}

.time-selector input:focus {
    outline: none;
    border-color: #667eea;
}

.search-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

#keyword-search {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    min-width: 250px;
    transition: border-color 0.3s ease;
}

#keyword-search:focus {
    outline: none;
    border-color: #667eea;
}

#search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

#search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.quick-filters h3 {
    margin-bottom: 15px;
    color: #555;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.timeline-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-height: 400px;
    backdrop-filter: blur(10px);
}

.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin: 40px 0;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.timeline-item:nth-child(odd) {
    text-align: right;
    margin-right: 50%;
    padding-right: 40px;
}

.timeline-item:nth-child(even) {
    text-align: left;
    margin-left: 50%;
    padding-left: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 20px;
    width: 16px;
    height: 16px;
    background: #667eea;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.timeline-item:nth-child(odd)::before {
    right: -8px;
}

.timeline-item:nth-child(even)::before {
    left: -8px;
}

.timeline-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.timeline-year {
    font-size: 1.4rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.timeline-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.timeline-author {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 12px;
    font-style: italic;
}

.timeline-summary {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.info-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 450px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: -5px 0 30px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: right 0.4s ease;
    overflow-y: auto;
}

.info-panel.open {
    right: 0;
}

.info-content {
    padding: 30px;
    height: 100%;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.concept-card {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.concept-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.concept-definition {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.concept-examples {
    font-size: 0.9rem;
    color: #666;
}

.stats-panel {
    display: flex;
    gap: 30px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #555;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        text-align: left;
        margin-left: 60px;
        margin-right: 0;
        padding-left: 20px;
        padding-right: 0;
    }
    
    .timeline-item::before,
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: 22px;
    }
    
    .info-panel {
        width: 100%;
        right: -100%;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    #keyword-search {
        min-width: 100%;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .time-selector {
        justify-content: center;
    }
}

/* Enhanced UI Improvements */
.secondary-btn {
    padding: 12px 20px;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.secondary-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.tag-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.tag-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    user-select: none;
}

.tag-checkbox:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.tag-checkbox.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tag-checkbox input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
}

.advanced-option {
    margin-bottom: 20px;
}

.advanced-option label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.advanced-option input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.advanced-option input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#apply-advanced {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

#apply-advanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Info Panel */
.info-panel {
    width: 500px;
}

.info-panel h2 {
    color: #333;
    margin-bottom: 15px;
    padding-right: 40px;
}

.info-panel h3 {
    color: #667eea;
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

/* Better Responsive Design */
@media (max-width: 992px) {
    .search-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .filter-section {
        flex-direction: column;
    }
    
    .tag-checkboxes {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .secondary-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .info-panel {
        width: 100%;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-body, .modal-header, .modal-footer {
        padding: 20px;
    }
}

/* Collapsible Tag Filters */
.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    user-select: none;
    transition: color 0.3s ease;
}

.collapsible-header:hover {
    color: #667eea;
}

.toggle-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: #667eea;
    transform: rotate(0deg);
}

.collapsible-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.toggle-icon.rotated {
    transform: rotate(-90deg);
}

/* Enhanced tag filters spacing */
.tag-filters {
    position: relative;
}

.tag-checkboxes {
    margin-top: 15px;
}


/* Enhanced Footer Styles - Replace the existing .site-footer section in styles.css */

.site-footer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    backdrop-filter: blur(15px);
    margin-top: 30px;
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    z-index: -1;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.footer-link:hover {
    color: #764ba2;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(118, 75, 162, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.footer-link svg {
    transition: transform 0.3s ease;
}

.footer-link:hover svg {
    transform: scale(1.1);
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.footer-disclaimer {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 15px;
    padding: 20px 25px;
    color: #b8860b;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.1);
    position: relative;
    overflow: hidden;
}

.footer-disclaimer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    z-index: -1;
}

.footer-disclaimer strong {
    color: #d39e00;
    font-weight: 700;
}

.footer-copyright {
    color: #555;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .footer-link {
        width: auto;
        justify-content: center;
        padding: 10px 18px;
    }
    
    .footer-info {
        gap: 20px;
    }
    
    .footer-disclaimer {
        padding: 18px 20px;
        font-size: 0.85rem;
        border-radius: 12px;
    }
    
    .site-footer {
        padding: 30px 0;
    }
}
