/* ============================================
   NLP Evolution Timeline - Enhanced Stylesheet
   Educational reference with benchmark focus
   ============================================ */

:root {
    --primary-color: #1a365d;
    --secondary-color: #2563eb;
    --accent-color: #dc2626;
    --success-color: #059669;
    --warning-color: #d97706;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --light-text: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3730a3 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

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.05'%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");
    opacity: 0.5;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    letter-spacing: -0.025em;
}

header .subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 0.5rem;
    position: relative;
}

header .meta {
    font-size: 0.875rem;
    opacity: 0.75;
    font-weight: 400;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Timeline Navigation
   ============================================ */
.timeline-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-track {
    display: flex;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.era-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    min-width: 80px;
}

.era-node:hover {
    background: var(--bg-color);
}

.era-node.active .node-dot {
    background: var(--secondary-color);
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.node-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    transition: var(--transition);
}

.node-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--light-text);
    text-align: center;
}

.era-node.active .node-label {
    color: var(--secondary-color);
}

/* ============================================
   Timeline Cards
   ============================================ */
.timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
}

.era {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.era::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    transform: scaleX(0);
    transition: var(--transition);
}

.era:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--secondary-color);
}

.era:hover::before {
    transform: scaleX(1);
}

.era-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.era h2 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.era-title {
    color: var(--secondary-color);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.era-tagline {
    color: var(--light-text);
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
}

.era-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.badge {
    background: var(--bg-color);
    color: var(--light-text);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.badge.highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #f59e0b;
}

/* Era-specific accent colors */
.era[data-era="era1"]::before { background: linear-gradient(90deg, #8b5cf6, #6366f1); }
.era[data-era="era2"]::before { background: linear-gradient(90deg, #6366f1, #3b82f6); }
.era[data-era="era3"]::before { background: linear-gradient(90deg, #3b82f6, #10b981); }
.era[data-era="era4"]::before { background: linear-gradient(90deg, #10b981, #f59e0b); }
.era[data-era="era5"]::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.era[data-era="era6"]::before { background: linear-gradient(90deg, #ef4444, #ec4899); }

/* ============================================
   Pedagogical Notes Section
   ============================================ */
.pedagogical-notes {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 3rem 2rem;
    margin: 2rem 0;
}

.pedagogical-notes h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.note-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.note-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.note-card h4 {
    color: #60a5fa;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.note-card p {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   Modal - Enhanced Educational Layout
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 2% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
    position: relative;
}

.close {
    color: var(--light-text);
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    background: white;
    box-shadow: var(--shadow);
}

.close:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

#modal-body {
    padding: 0;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #3730a3);
    color: white;
    padding: 2.5rem;
    position: relative;
}

.era-period {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.modal-tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    font-style: italic;
    font-weight: 300;
}

/* Modal Sections */
.modal-section {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-section:last-of-type {
    border-bottom: none;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-col h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--light-text);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.modal-col p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Paradigm Box */
.paradigm-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid var(--secondary-color);
}

.paradigm-box h3 {
    color: var(--secondary-color);
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.key-shift {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(37, 99, 235, 0.2);
    color: var(--primary-color);
}

.rep-task {
    font-size: 1.125rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Milestones */
.milestones-section {
    background: var(--bg-color);
}

.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.milestone-item {
    display: flex;
    gap: 1rem;
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.milestone-year {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--secondary-color);
    background: #eff6ff;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    height: fit-content;
    white-space: nowrap;
}

.milestone-content strong {
    display: block;
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.milestone-content p {
    color: var(--light-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Techniques */
.techniques-section {
    background: white;
}

.techniques-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.techniques-list li {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    font-size: 0.9rem;
}

/* Pros & Cons */
.pros-cons {
    padding: 0;
    gap: 0;
}

.pros-cons .modal-col {
    padding: 2rem 2.5rem;
}

.pros-cons .pros {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-right: 1px solid var(--border-color);
}

.pros-cons .cons {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.pros-cons h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 1rem;
}

.pros h3 { color: var(--success-color); }
.cons h3 { color: var(--accent-color); }

.pros-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros-cons li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.6;
}

.pros-cons li::before {
    content: '•';
    position: absolute;
    left: 0;
    font-weight: bold;
}

.pros li::before { color: var(--success-color); }
.cons li::before { color: var(--accent-color); }

.pros strong { color: var(--success-color); }
.cons strong { color: var(--accent-color); }

/* Educational Highlight */
.educational-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    margin: 2rem 2.5rem 2.5rem;
    border-radius: 12px;
    padding: 1.5rem;
}

.educational-highlight h3 {
    color: #92400e;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edu-note-box p {
    color: #78350f;
    font-size: 1rem;
    line-height: 1.7;
    font-style: italic;
}

/* ============================================
   Footer
   ============================================ */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.footer-content p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-meta {
    font-size: 0.875rem;
    opacity: 0.7;
    font-style: italic;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    header h1 { font-size: 2rem; }
    header .subtitle { font-size: 1.125rem; }
    
    .nav-track { gap: 0.5rem; }
    .node-label { font-size: 0.625rem; }
    
    .timeline { grid-template-columns: 1fr; padding: 2rem 1rem; }
    
    .modal-grid { grid-template-columns: 1fr; gap: 1rem; }
    .modal-header { padding: 1.5rem; }
    .modal-header h2 { font-size: 1.5rem; }
    .modal-section { padding: 1.5rem; }
    .pros-cons .modal-col { padding: 1.5rem; }
    .educational-highlight { margin: 1.5rem; }
    
    .techniques-list { grid-template-columns: 1fr; }
    .milestone-item { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
    header { padding: 2rem 1rem; }
    header h1 { font-size: 1.5rem; }
    
    .era { padding: 1.5rem; }
    .era-icon { font-size: 2rem; }
    
    .modal-content { width: 95%; margin: 5% auto; }
    .close { top: 0.5rem; right: 0.5rem; }
}

/* Print styles for educational handouts */
@media print {
    .modal { 
        position: static; 
        display: block !important; 
        background: none;
        page-break-after: always;
    }
    .modal-content { 
        box-shadow: none; 
        max-height: none;
        margin: 0;
        width: 100%;
    }
    .close, .timeline, .timeline-nav, .pedagogical-notes, footer { display: none; }
    body { background: white; }
}