/* ========================================
   UW-MADISON ACADEMIC WEBSITE STYLES
   Prof. Maxim Vavilov - Condensed Matter Theory
   ======================================== */

/* Import Red Hat fonts */
@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@400;500;600;700;800;900&family=Red+Hat+Text:wght@400;500;600;700&display=swap');

/* UW-Madison Color Palette */
:root {
    /* Primary Colors */
    --color-uw-red: #C5050C;           /* UW Madison Red */
    --color-dark-red: #9B0000;         /* Dark Red for highlights */
    --color-text-dark: #333333;        /* Text Dark Gray */
    --color-text-medium: #666666;      /* Medium Gray */
    --color-text-light: #999999;       /* Light Gray */
    
    /* Backgrounds */
    --color-bg-white: #FFFFFF;
    --color-bg-light: #F8F8F8;
    --color-bg-gray: #EEEEEE;
    
    /* Borders */
    --color-border: #DDDDDD;
    --color-border-light: #E8E8E8;
    
    /* Typography */
    --font-display: 'Red Hat Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-text: 'Red Hat Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    --transition: 0.3s ease;
}

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

body {
    font-family: var(--font-text);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-dark);
    background: var(--color-bg-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--color-text-medium);
}

a {
    color: var(--color-uw-red);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-dark-red);
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-uw-red);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-brand-logo {
    height: 50px;
    width: auto;
}

.nav-brand-logo img {
    height: 100%;
    width: auto;
    filter: brightness(0) invert(1); /* Make logo white */
}

.nav-brand-text h1 {
    font-size: 1.3rem;
    color: var(--color-bg-white);
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.nav-brand-text p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
}

.nav-menu li a {
    display: block;
    color: var(--color-bg-white);
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-display);
    transition: all var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: var(--color-bg-white);
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: var(--color-bg-white);
    transition: 0.3s;
    border-radius: 2px;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin: 2rem auto 4rem;
    padding: 3rem;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hero-image {
    flex-shrink: 0;
    width: 280px;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.hero-content h2 {
    font-size: 1.3rem;
    color: var(--color-uw-red);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-content h3 {
    font-size: 1.1rem;
    color: var(--color-text-medium);
    font-weight: 500;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text-medium);
}

/* ========================================
   SECTION CARDS
   ======================================== */

.section-card {
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-text-dark);
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    font-weight: 800;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--color-uw-red);
}

/* ========================================
   RESEARCH GRID
   ======================================== */

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.research-card {
    background: var(--color-bg-light);
    padding: 2rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: all var(--transition);
    position: relative;
}

.research-card:hover {
    border-color: var(--color-uw-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 5, 12, 0.15);
}

.research-card h3 {
    color: var(--color-uw-red);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.research-card p {
    color: var(--color-text-medium);
    line-height: 1.7;
    font-size: 0.95rem;
}

.research-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* ========================================
   PUBLICATIONS - Academic Style
   ======================================== */

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.publication-item {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-left: 4px solid var(--color-uw-red);
    border-radius: 4px;
    transition: all var(--transition);
}

.publication-item:hover {
    background: var(--color-bg-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.publication-title {
    font-size: 1.1rem;
    color: var(--color-text-dark);
    margin-bottom: 0.6rem;
    font-weight: 700;
    line-height: 1.4;
}

.publication-authors {
    color: var(--color-text-medium);
    font-style: italic;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.publication-venue {
    color: var(--color-uw-red);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.publication-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.publication-links a {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-uw-red);
    font-weight: 600;
    transition: all var(--transition);
}

.publication-links a:hover {
    background: var(--color-uw-red);
    color: var(--color-bg-white);
    border-color: var(--color-uw-red);
}

/* ========================================
   NEWS SECTION
   ======================================== */

.news-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid var(--color-dark-red);
    display: flex;
    gap: 2rem;
}

.news-date {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--color-uw-red);
    min-width: 110px;
    font-size: 0.9rem;
    font-family: var(--font-display);
}

.news-content {
    color: var(--color-text-medium);
    line-height: 1.7;
}

.news-content strong {
    color: var(--color-text-dark);
}

/* ========================================
   TEAM SECTION
   ======================================== */

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    margin: 2rem 0;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
    margin-bottom: 1rem;
    transition: all var(--transition);
}

.team-member img:hover {
    border-color: var(--color-uw-red);
    transform: scale(1.03);
}

.team-member h4 {
    color: var(--color-text-dark);
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.team-member p {
    color: var(--color-text-medium);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    background: var(--color-uw-red);
    color: var(--color-bg-white);
    font-weight: 700;
    font-family: var(--font-display);
    border-radius: 4px;
    transition: all var(--transition);
    border: 2px solid var(--color-uw-red);
    font-size: 0.95rem;
    cursor: pointer;
}

.btn:hover {
    background: var(--color-dark-red);
    border-color: var(--color-dark-red);
    color: var(--color-bg-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 5, 12, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-uw-red);
    color: var(--color-uw-red);
}

.btn-outline:hover {
    background: var(--color-uw-red);
    color: var(--color-bg-white);
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: var(--color-bg-light);
    border-top: 1px solid var(--color-border);
    padding: 2rem;
    text-align: center;
    color: var(--color-text-medium);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--color-uw-red);
}

footer a:hover {
    color: var(--color-dark-red);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-uw-red);
        flex-direction: column;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li a {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-menu li a:hover,
    .nav-menu li a.active {
        border-left-color: var(--color-bg-white);
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    .hero-container {
        flex-direction: column;
        padding: 2rem;
        gap: 2rem;
    }
    
    .hero-image {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .research-grid {
        grid-template-columns: 1fr;
    }
    
    .news-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .news-date {
        min-width: auto;
    }
    
    .nav-brand-logo {
        height: 40px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

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

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden {
    display: none !important;
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-uw-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Year headers in publications */
.year-header {
    color: var(--color-text-dark);
    font-size: 1.5rem;
    font-family: var(--font-display);
    font-weight: 800;
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-uw-red);
}

/* ===== Research Themes Styles ===== */
#research-themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.theme-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(197, 5, 12, 0.15);
}

.theme-card-inner {
    padding: 2rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.theme-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #C5050C 0%, #9B0000 100%);
    border-radius: 50%;
    padding: 1rem;
    transition: transform 0.3s ease;
}

.theme-card:hover .theme-icon {
    transform: scale(1.1) rotate(5deg);
}

.theme-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Make icons white */
}

.theme-title {
    color: var(--color-uw-red);
    font-size: 1.3rem;
    font-family: var(--font-display);
    margin-bottom: 1rem;
    font-weight: 600;
}

.theme-description {
    color: var(--color-text-medium);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Animation for theme cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.theme-card:nth-child(1) { animation-delay: 0.1s; }
.theme-card:nth-child(2) { animation-delay: 0.2s; }
.theme-card:nth-child(3) { animation-delay: 0.3s; }
.theme-card:nth-child(4) { animation-delay: 0.4s; }
.theme-card:nth-child(5) { animation-delay: 0.5s; }
.theme-card:nth-child(6) { animation-delay: 0.6s; }

/* Theme Papers Styling */
.theme-papers {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    text-align: left;
}

.theme-paper-item {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #f0f0f0;
}

.theme-paper-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.paper-title-small {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.paper-meta {
    font-size: 0.85rem;
    color: var(--color-text-medium);
    margin-bottom: 0.4rem;
}

.paper-authors {
    font-style: italic;
}

.paper-venue-small {
    font-size: 0.85rem;
    color: var(--color-text-medium);
}

.paper-venue-small strong {
    color: var(--color-uw-red);
    font-weight: 600;
}

.paper-venue-small a {
    color: var(--color-uw-red);
    text-decoration: none;
    transition: all 0.2s ease;
}

.paper-venue-small a:hover {
    color: var(--color-dark-red);
    text-decoration: underline;
}

.paper-venue-small a strong {
    color: inherit;
}

.theme-papers-empty {
    margin-top: 1.5rem;
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ===== Thumbs Up Animation ===== */
.thumbs-up-emoji {
    position: absolute;
    font-size: 6rem;
    pointer-events: none;
    z-index: 1000;
    animation: thumbsUpJump 1s ease-out forwards;
}

@keyframes thumbsUpJump {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
    }
}

.hero-image {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.hero-image:hover {
    transform: scale(1.02);
}

/* ===== Members Grid ===== */
#members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.member-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(197, 5, 12, 0.15);
    border-color: var(--color-uw-red);
}

.member-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--color-border);
    transition: border-color 0.3s ease;
}

.member-card:hover .member-photo {
    border-color: var(--color-uw-red);
}

.member-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.3rem;
}

.member-position {
    font-size: 0.9rem;
    color: var(--color-uw-red);
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.member-bio {
    font-size: 0.9rem;
    color: var(--color-text-medium);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.member-links {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.member-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-light);
    color: var(--color-text-medium);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.member-link:hover {
    background: var(--color-uw-red);
    color: white;
    transform: scale(1.1);
}

.member-link.website {
    background: transparent;
    border: 2px solid var(--color-uw-red);
    color: var(--color-uw-red);
    font-size: 0.75rem;
    font-weight: 600;
    width: auto;
    padding: 0 0.8rem;
    border-radius: 20px;
}

.member-link.website:hover {
    background: var(--color-uw-red);
    color: white;
}

@media (max-width: 768px) {
    #members-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
