:root {
    --primary-color: #f8f9fa;
    --secondary-color: #ffffff;
    --accent-color: #b8860b; /* Dark Goldenrod */
    --text-color: #2b2d42;
    --text-muted: #6c757d;
    --bg-color: #fdfdfd;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Header Styles */
header {
    padding: 60px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, #f0f4f8 0%, var(--bg-color) 100%);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--text-color);
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 30px;
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
}

#searchBar {
    width: 100%;
    padding: 15px 25px;
    border-radius: 50px;
    border: 1px solid #e0e0e0;
    background-color: var(--secondary-color);
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: var(--transition);
    outline: none;
}

#searchBar:focus {
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: var(--accent-color);
}

/* View Switcher */
.view-switcher {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 20px;
    border-radius: 20px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--accent-color);
    background-color: rgba(184, 134, 11, 0.05);
}

.nav-link.active {
    color: var(--accent-color);
    background-color: rgba(184, 134, 11, 0.1);
    border-color: rgba(184, 134, 11, 0.2);
}

/* Grid Layout */
.nobel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 40px 0;
}

/* Year Group Container */
.year-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 20px;
    background-color: var(--secondary-color);
    border-radius: 16px;
    position: relative;
    border: 1px solid #eee;
    transition: var(--transition);
}

.year-group:hover {
    border-color: var(--accent-color);
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.year-group.multiple {
    background-color: #fafbfc;
    border: 2px solid #e8eef3;
}

.year-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--accent-color);
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 5;
}

.year-group .laureate-card {
    flex: 1;
    min-width: 0; /* Allow shrinking */
    box-shadow: none;
    border: 1px solid #f0f0f0;
}

.year-group.multiple .laureate-card {
    background: white;
}

/* Card Styles */
.laureate-card {
    background-color: var(--secondary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.03);
}

.laureate-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1.2;
    overflow: hidden;
    background-color: #f1f1f1;
    position: relative;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.laureate-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
    text-align: center;
}

.card-year {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.card-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

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

.modal-content {
    background-color: var(--secondary-color);
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: modalScale 0.4s ease-out;
}

@keyframes modalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-button {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-button:hover {
    color: var(--text-color);
}

.modal-header {
    display: flex;
    flex-wrap: wrap;
    padding: 40px;
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 20px 20px 0 0;
    align-items: center;
    gap: 30px;
}

.modal-image {
    flex: 0 0 200px;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-title-box {
    flex: 1;
}

#modal-name {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

#modal-year {
    color: var(--accent-color);
    font-weight: 300;
    font-size: 1.5rem;
}

.modal-info {
    padding: 40px;
}

.modal-info h4 {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.modal-info p {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 30px;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin-bottom: 30px;
}

/* Loader Styles */
.loader-container {
    text-align: center;
    padding: 100px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(184, 134, 11, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer Styles */
footer {
    padding: 60px 0;
    text-align: center;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    margin-top: 60px;
}

.data-source {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.data-source a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 40px auto;
    padding: 40px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #e0e0e0;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    margin-bottom: 30px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-color);
    border: 4px solid var(--accent-color);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 25px;
    background-color: var(--secondary-color);
    position: relative;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    transition: var(--transition);
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: var(--accent-color);
}

.timeline-year {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 10px;
    font-family: 'Playfair Display', serif;
}

.timeline-motivation {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 15px;
    font-style: italic;
    line-height: 1.4;
}

.timeline-winners {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.winner-tag {
    background-color: #f0f4f8;
    color: var(--text-color);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.winner-tag:hover {
    background-color: var(--accent-color);
    color: white;
}

@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item::after {
        left: 21px;
    }
    
    .right {
        left: 0%;
    }
}
