/* ============================================
   M.-Lounes BENTAHA - Academic Website
   Professional CSS with Dark/Light Mode
   ============================================ */

/* ============================================
   Self-Hosted Fonts (@font-face)
   ============================================ */

/* Source Sans 3 - Body Font */
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/source-sans-3-300.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/source-sans-3-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/source-sans-3-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/source-sans-3-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/source-sans-3-700.woff2') format('woff2');
}

/* Playfair Display - Heading Font */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/playfair-display-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/playfair-display-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/playfair-display-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/playfair-display-700.woff2') format('woff2');
}

/* JetBrains Mono - Code Font */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/jetbrains-mono-500.woff2') format('woff2');
}

/* ============================================
   CSS Variables - Light Theme (Default)
   ============================================ */
:root {
    /* Primary Colors - Based on your CV's bluemunsell */
    --primary: #0080B0;
    --primary-dark: #006690;
    --primary-light: #00a0d4;
    --primary-subtle: rgba(0, 128, 176, 0.1);
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --bg-code: #f4f4f4;
    
    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-tertiary: #6c757d;
    --text-muted: #8a8a9a;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-light: #e0e0e0;
    --border-medium: #d0d0d0;
    
    /* Accent Colors */
    --accent-gold: #c9a227;
    --accent-success: #28a745;
    --accent-warning: #ffc107;
    --accent-danger: #dc3545;
    --accent-purple: #6f42c1;
    --accent-blue: #007bff;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    
    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50%;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Layout */
    --max-width: 1200px;
    --header-height: 70px;
}

/* ============================================
   Dark Theme
   ============================================ */
[data-theme="dark"] {
    --primary: #4db8d9;
    --primary-dark: #3aa0c0;
    --primary-light: #6dcef0;
    --primary-subtle: rgba(77, 184, 217, 0.15);
    
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    --bg-code: #2d333b;
    
    --text-primary: #e6edf3;
    --text-secondary: #b1bac4;
    --text-tertiary: #8b949e;
    --text-muted: #6e7681;
    --text-inverse: #0d1117;
    
    --border-light: #30363d;
    --border-medium: #444c56;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

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

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

strong, b {
    font-weight: 600;
}

/* ============================================
   Layout Components
   ============================================ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section {
    padding: var(--spacing-3xl) 0;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}

.subsection-title {
    font-size: 1.4rem;
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--primary);
}

/* Research Page Specific Styles */
.research-page .section-title {
    font-size: 1.3rem;
}

.research-page .subsection-title {
    font-size: 1.13rem !important;
}

.research-page .supervision-status-title {
    font-size: 0.96rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Compact PhD supervision cards */
.research-page .supervision-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.research-page .supervision-item h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.research-page .supervision-header {
    margin-bottom: 0.25rem;
}

.research-page .supervision-details {
    font-size: 0.85rem;
}

.research-page .supervision-details p {
    margin-bottom: 0.15rem;
}

.research-page .supervision-list {
    margin-bottom: 1rem;
}

.research-page .review-title,
.research-page .conference-title,
.research-page .project-title {
    font-size: 1.01rem;
}

/* Teaching Page Specific Styles */
.teaching-page .subsection-title {
    font-size: 1.13rem !important;
}

.teaching-page .institution-title {
    font-size: 0.96rem;
}

/* Publications Page Specific Styles */
.publications-page .year-header {
    font-size: 1.2rem;
}

/* Compact publication cards */
.publications-page .publication-item {
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.4rem;
    gap: 0.6rem;
}

.publications-page .publication-type-badge {
    width: 45px;
    height: 45px;
    font-size: 0.6rem;
}

.publications-page .publication-title {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.publications-page .publication-authors {
    font-size: 0.82rem;
    margin-bottom: 0.1rem;
}

.publications-page .publication-venue {
    font-size: 0.82rem;
}

.publications-page .publication-link {
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.publications-page .publications-list {
    gap: 0.4rem;
}

/* Software Download Links */
.software-download {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.software-download a {
    color: var(--primary);
    text-decoration: none;
}

.software-download a:hover {
    text-decoration: underline;
}

.software-download.hidden {
    display: none;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    background: transparent;
    width: 42px;
    height: 42px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.logo:hover {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
    text-decoration: none;
    transform: scale(1.05);
}

.logo span {
    color: var(--primary);
}

/* Main Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-xs);
}

.nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background-color: var(--primary-subtle);
    text-decoration: none;
    font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: var(--spacing-md);
}

.theme-toggle:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill var(--transition-fast);
}

.theme-toggle:hover svg {
    fill: var(--primary);
}

/* Sun/Moon icons visibility */
.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ============================================
   Main Content Area
   ============================================ */
.main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - 80px);
}

/* ============================================
   Profile Card (Home Page)
   ============================================ */
.profile-section {
    padding: var(--spacing-3xl) 0;
}

.profile-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--spacing-2xl);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
}

.profile-image-container {
    position: relative;
}

.profile-image {
    width: 180px;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.profile-info h1 {
    font-size: 1.5rem !important;
    margin-bottom: var(--spacing-sm);
}

.profile-title {
    font-size: 1.02rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.profile-affiliation {
    margin-bottom: var(--spacing-lg);
    font-size: 0.95rem;
}

.profile-affiliation p {
    margin-bottom: var(--spacing-xs);
}

.profile-affiliation a {
    font-weight: 500;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.detail-item svg {
    width: 18px;
    height: 18px;
    fill: var(--primary);
    flex-shrink: 0;
    margin-top: 3px;
}

.detail-item span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.detail-item a {
    color: var(--text-secondary);
}

.detail-item a:hover {
    color: var(--primary);
}

.contact-image {
    height: 22px;
    width: auto;
}

/* Dark mode contact images */
[data-theme="dark"] .contact-image {
    filter: invert(1) brightness(0.85);
}

/* Social/Academic Links */
.academic-links {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
}

.academic-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.academic-link:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
    transform: translateY(-2px);
}

.academic-link img,
.academic-link svg {
    width: 20px;
    height: 20px;
}

.academic-link svg {
    fill: currentColor;
}

/* ============================================
   Cards & Boxes
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    text-align: left;
}

.card h3 {
    font-size: 1.2rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ============================================
   Publications Page
   ============================================ */
.publications-header {
    margin-bottom: var(--spacing-xl);
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: var(--spacing-xl);
}

.filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: fit-content;
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    min-width: 180px;
    transition: all var(--transition-fast);
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--primary);
    outline: none;
}

.publication-stats {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--primary-subtle);
    border-radius: var(--radius-md);
    border-left: none;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    min-width: 80px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* Inline stats */
.stat-item-inline {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.stat-label-inline {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-number-inline {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Center stats containers */
.publication-stats,
.teaching-stats {
    justify-content: center;
}

/* Theme items in single card */
.theme-item {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

/* Shared course indicator */
.shared-course {
    color: var(--primary);
    font-size: 0.85rem;
    margin-left: 0.25rem;
    cursor: help;
}

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

.theme-item:first-child {
    padding-top: 0;
}

.theme-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-xs) 0;
}

.theme-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Inline software labels */
.software-inline-label {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    margin-right: var(--spacing-xs);
    vertical-align: baseline;
}

/* Software tags in theme-item */
.theme-item .software-tags-inline {
    margin-top: var(--spacing-xs);
}

/* Publication Items */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.publication-year-group {
    margin-bottom: var(--spacing-xl);
}

.year-header {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.year-count {
    font-size: 0.9rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-tertiary);
}

.publication-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.publication-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.publication-item.hidden {
    display: none;
}

.publication-type-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    background: var(--primary-subtle);
    border-radius: var(--radius-md);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
}

.publication-type-badge.journal { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.publication-type-badge.conference { background: rgba(0, 123, 255, 0.15); color: #007bff; }
.publication-type-badge.book { background: rgba(111, 66, 193, 0.15); color: #6f42c1; }

[data-theme="dark"] .publication-type-badge.journal { background: rgba(40, 167, 69, 0.25); color: #5fd87a; }
[data-theme="dark"] .publication-type-badge.conference { background: rgba(0, 123, 255, 0.25); color: #6db3f2; }
[data-theme="dark"] .publication-type-badge.book { background: rgba(111, 66, 193, 0.25); color: #a78bfa; }

.publication-content {
    flex: 1;
}

.publication-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.publication-authors {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.publication-authors .highlight {
    font-weight: 600;
    color: var(--primary);
}

.publication-venue {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-tertiary);
}

.publication-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.no-results {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-tertiary);
    font-style: italic;
}

/* ============================================
   Research Page
   ============================================ */
.research-intro {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    border-left: none;
}

.research-intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0;
}

.research-themes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.theme-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.theme-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.theme-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.theme-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.theme-card h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
}

.theme-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Awards Section */
.awards-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.award-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    border-left: none;
    transition: all var(--transition-fast);
}

.award-item:hover {
    box-shadow: var(--shadow-sm);
}

.award-date {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--accent-gold);
    min-width: 100px;
    font-size: 0.95rem;
}

.award-content h4 {
    margin-bottom: var(--spacing-xs);
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
}

.award-content p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-tertiary);
}

.award-content a {
    font-size: 0.85rem;
}

/* PhD Supervision */
.supervision-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.supervision-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-fast);
}

.supervision-item:hover {
    box-shadow: var(--shadow-sm);
}

.supervision-item.completed {
    border-left: none;
}

.supervision-item.ongoing {
    border-left: none;
}

.supervision-item.discontinued {
    border-left: none;
}

.supervision-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.supervision-status {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.supervision-status.completed { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.supervision-status.ongoing { background: var(--primary-subtle); color: var(--primary); }
.supervision-status.discontinued { background: var(--bg-tertiary); color: var(--text-muted); }

/* Education degree labels */
.supervision-status.edu-phd { background: rgba(79, 70, 229, 0.15); color: #4f46e5; }
.supervision-status.edu-msc { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }
.supervision-status.edu-eng { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.supervision-status.edu-eng2nd { background: rgba(180, 83, 9, 0.15); color: #b45309; }
.supervision-status.edu-eng1st { background: rgba(6, 182, 212, 0.15); color: #0891b2; }
.supervision-status.edu-cpge { background: rgba(219, 39, 119, 0.15); color: #db2777; }

[data-theme="dark"] .supervision-status.completed { background: rgba(40, 167, 69, 0.25); color: #5fd87a; }
[data-theme="dark"] .supervision-status.edu-phd { background: rgba(79, 70, 229, 0.25); color: #818cf8; }
[data-theme="dark"] .supervision-status.edu-msc { background: rgba(20, 184, 166, 0.25); color: #2dd4bf; }
[data-theme="dark"] .supervision-status.edu-eng { background: rgba(249, 115, 22, 0.25); color: #fb923c; }
[data-theme="dark"] .supervision-status.edu-eng2nd { background: rgba(180, 83, 9, 0.25); color: #fbbf24; }
[data-theme="dark"] .supervision-status.edu-eng1st { background: rgba(6, 182, 212, 0.25); color: #22d3ee; }
[data-theme="dark"] .supervision-status.edu-cpge { background: rgba(219, 39, 119, 0.25); color: #f472b6; }

.supervision-period {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.supervision-item h4 {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.supervision-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.supervision-details p {
    margin-bottom: var(--spacing-xs);
}

.supervision-item-row {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.supervision-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.supervision-item-row:first-child {
    padding-top: 0;
}

.supervision-item-row > div {
    flex: 1;
}

.supervision-item-row h4 {
    font-size: 0.95rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.supervision-item-row .supervision-status {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 110px;
    text-align: center;
    align-self: flex-start;
    margin-top: 2px;
}

/* Gold label for awards */
.supervision-status.award {
    background: rgba(212, 175, 55, 0.2);
    color: #b8860b;
}

[data-theme="dark"] .supervision-status.award {
    background: rgba(212, 175, 55, 0.25);
    color: #daa520;
}

.award-content-inline {
    flex: 1;
}

.award-content-inline h4 {
    font-size: 0.95rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin: 0 0 var(--spacing-xs) 0;
    line-height: 1.4;
}

.award-content-inline p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.award-content-inline a {
    color: var(--primary);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.project-type {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.project-type.horizon { background: rgba(0, 86, 179, 0.15); color: #0056b3; }
.project-type.h2020 { background: rgba(0, 86, 179, 0.15); color: #0056b3; }
.project-type.erasmus { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.project-type.international { background: rgba(0, 128, 176, 0.15); color: #0080b0; }
.project-type.national { background: rgba(156, 39, 176, 0.15); color: #9c27b0; }

[data-theme="dark"] .project-type.horizon,
[data-theme="dark"] .project-type.h2020 { background: rgba(0, 123, 255, 0.25); color: #6db3f2; }
[data-theme="dark"] .project-type.erasmus { background: rgba(40, 167, 69, 0.25); color: #5fd87a; }
[data-theme="dark"] .project-type.international { background: rgba(0, 128, 176, 0.25); color: #4db8d9; }
[data-theme="dark"] .project-type.national { background: rgba(156, 39, 176, 0.25); color: #ce93d8; }

.project-period {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.project-card h4 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
}

.project-card h4 a {
    color: var(--text-primary);
}

.project-card h4 a:hover {
    color: var(--primary);
}

.project-description {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-sm);
}

.project-partners {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   Teaching Page
   ============================================ */
.teaching-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-light);
}

.teaching-stat {
    text-align: center;
    padding: var(--spacing-sm);
}

.teaching-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.teaching-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.teaching-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.institution-group {
    margin-bottom: var(--spacing-2xl);
}

.institution-group.hidden {
    display: none;
}

.institution-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary);
}

.institution-info h3 {
    margin-bottom: 0;
    font-size: 1.3rem;
}

.institution-info span {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: all var(--transition-fast);
}

.course-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.course-card.hidden {
    display: none;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.course-level {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}

.course-level.but { background: rgba(0, 123, 255, 0.15); color: #007bff; }
.course-level.lp { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.course-level.master { background: rgba(111, 66, 193, 0.15); color: #6f42c1; }
.course-level.engineering { background: rgba(255, 193, 7, 0.15); color: #d39e00; }

[data-theme="dark"] .course-level.but { background: rgba(0, 123, 255, 0.25); color: #6db3f2; }
[data-theme="dark"] .course-level.lp { background: rgba(40, 167, 69, 0.25); color: #5fd87a; }
[data-theme="dark"] .course-level.master { background: rgba(111, 66, 193, 0.25); color: #a78bfa; }
[data-theme="dark"] .course-level.engineering { background: rgba(255, 193, 7, 0.25); color: #fbbf24; }

.course-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    font-size: 0.95rem;
}

.course-program {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* ============================================
   Software Page
   ============================================ */
.software-intro {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-left: none;
    text-align: left;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.software-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.software-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.software-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.software-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-subtle);
    border-radius: var(--radius-md);
}

.software-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.software-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

.software-tag {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
}

/* ============================================
   Links Page
   ============================================ */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.links-category {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

/* Links category colors - Light mode */
.links-blue-label { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.links-green-label { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.links-purple-label { background: rgba(147, 51, 234, 0.15); color: #9333ea; }
.links-orange-label { background: rgba(249, 115, 22, 0.15); color: #ea580c; }
.links-teal-label { background: rgba(20, 184, 166, 0.15); color: #0d9488; }
.links-pink-label { background: rgba(236, 72, 153, 0.15); color: #db2777; }

/* Links category colors - Dark mode */
[data-theme="dark"] .links-blue-label { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
[data-theme="dark"] .links-green-label { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
[data-theme="dark"] .links-purple-label { background: rgba(147, 51, 234, 0.2); color: #c084fc; }
[data-theme="dark"] .links-orange-label { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
[data-theme="dark"] .links-teal-label { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; }
[data-theme="dark"] .links-pink-label { background: rgba(236, 72, 153, 0.2); color: #f472b6; }

/* Inline links style */
.links-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    flex: 1;
}

.links-inline a {
    color: var(--text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.links-inline a:hover {
    background: var(--primary-subtle);
    color: var(--primary);
    text-decoration: none;
}

/* Links page specific label width */
.links-blue-label,
.links-green-label,
.links-purple-label,
.links-orange-label,
.links-teal-label,
.links-pink-label {
    min-width: 130px;
    width: 130px;
    text-align: left !important;
}

/* ============================================
   Shared Personal Content Section (Links page)
   ============================================ */

/* Hidden class for managing visibility */
.hidden {
    display: none !important;
}

.shared-content-section {
    margin-top: var(--spacing-xl);
}

.shared-content-section .subsection-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary);
}

[data-theme="dark"] .shared-content-section .subsection-title {
    color: #e5e7eb;
}

.shared-content-subsection {
    margin-bottom: var(--spacing-xl);
}

.shared-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.shared-content-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

[data-theme="dark"] .shared-content-label {
    color: #e5e7eb;
}

.shared-content-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.shared-content-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.shared-content-toggle .toggle-icon {
    font-size: 0.75rem;
    transition: transform var(--transition-normal);
}

.shared-content-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.shared-content-items {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    padding-top: var(--spacing-md);
}

.shared-content-items.visible {
    display: grid;
}

.shared-content-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.shared-content-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.shared-content-media {
    position: relative;
    width: 100%;
    background: var(--bg-tertiary);
}

.shared-content-media img {
    width: 100%;
    height: auto;
    display: block;
}

.shared-content-media video {
    width: 100%;
    height: auto;
    display: block;
}

.shared-content-description {
    padding: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Dark mode adjustments */
[data-theme="dark"] .shared-content-header {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .shared-content-item {
    background: var(--bg-secondary);
}

[data-theme="dark"] .shared-content-media {
    background: var(--bg-tertiary);
}

/* Responsive */
@media (max-width: 640px) {
    .shared-content-items {
        grid-template-columns: 1fr;
    }
    
    .shared-content-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
}

/* Software label colors - Light mode */
.software-optim-label { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.software-planning-label { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.software-dss-label { background: rgba(249, 115, 22, 0.15); color: #ea580c; }
.software-meta-label { background: rgba(147, 51, 234, 0.15); color: #9333ea; }

/* Software label colors - Dark mode */
[data-theme="dark"] .software-optim-label { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
[data-theme="dark"] .software-planning-label { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
[data-theme="dark"] .software-dss-label { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
[data-theme="dark"] .software-meta-label { background: rgba(147, 51, 234, 0.2); color: #c084fc; }

/* Software page specific label width */
.software-optim-label,
.software-planning-label,
.software-dss-label,
.software-meta-label {
    min-width: 130px;
    width: 130px;
    text-align: left !important;
}

/* Software content styling */
.software-content {
    flex: 1;
}

.software-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-xs) 0;
}

.software-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-sm) 0;
}

.software-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.software-tags-inline span {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

/* Teaching label colors - Light mode */
.teaching-but-label { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.teaching-lp-label { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.teaching-master-label { background: rgba(147, 51, 234, 0.15); color: #9333ea; }
.teaching-eng-label { background: rgba(249, 115, 22, 0.15); color: #ea580c; }

/* Teaching label colors - Dark mode */
[data-theme="dark"] .teaching-but-label { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
[data-theme="dark"] .teaching-lp-label { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
[data-theme="dark"] .teaching-master-label { background: rgba(147, 51, 234, 0.2); color: #c084fc; }
[data-theme="dark"] .teaching-eng-label { background: rgba(249, 115, 22, 0.2); color: #fb923c; }

/* Teaching page specific label widths - fitted to content */
.teaching-but-label {
    min-width: auto;
    width: auto;
    text-align: left !important;
}

.teaching-lp-label {
    min-width: auto;
    width: auto;
    text-align: left !important;
}

.teaching-master-label {
    min-width: auto;
    width: auto;
    text-align: left !important;
}

.teaching-eng-label {
    min-width: auto;
    width: auto;
    text-align: left !important;
}

.teaching-level-info {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.8;
}

/* Teaching content styling */
.teaching-content {
    flex: 1;
}

.teaching-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.teaching-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: var(--spacing-xs) 0 0 0;
}

.teaching-period {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Institution title */
.institution-title {
    font-size: 1.1rem;
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
}

.institution-title a {
    color: inherit;
}

.institution-title a:hover {
    color: var(--primary);
}

.links-category h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary);
}

.links-list {
    list-style: none;
}

.links-list li {
    margin-bottom: var(--spacing-sm);
}

.links-list a {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.links-list a:hover {
    background: var(--primary-subtle);
    color: var(--primary);
    text-decoration: none;
}

.links-list svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-3xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-links a {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-sm) !important; }
.mb-2 { margin-bottom: var(--spacing-md) !important; }
.mb-3 { margin-bottom: var(--spacing-lg) !important; }
.mb-4 { margin-bottom: var(--spacing-xl) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-sm) !important; }
.mt-2 { margin-top: var(--spacing-md) !important; }
.mt-3 { margin-top: var(--spacing-lg) !important; }
.mt-4 { margin-top: var(--spacing-xl) !important; }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 992px) {
    .profile-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .profile-image-container {
        justify-self: center;
    }
    
    .profile-details {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        justify-content: center;
    }
    
    .academic-links {
        justify-content: center;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 69px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    
    .nav-list {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-link {
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-light);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .filters-container {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .publication-stats {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .award-item {
        flex-direction: column;
    }
    
    .award-date {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-md);
    }
    
    .profile-card {
        padding: var(--spacing-lg);
    }
    
    .profile-image {
        width: 150px;
        height: 180px;
    }
    
    .academic-links {
        flex-direction: column;
    }
    
    .academic-link {
        justify-content: center;
    }
    
    .publication-item {
        flex-direction: column;
    }
    
    .publication-type-badge {
        width: 100%;
        height: auto;
        padding: var(--spacing-sm);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .theme-toggle,
    .mobile-menu-toggle,
    .filters-container,
    .teaching-filters {
        display: none !important;
    }
    
    .main {
        margin-top: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .card,
    .publication-item,
    .project-card,
    .course-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
}

/* Publication DOI/URL links */
.publication-link {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.publication-link a {
    color: var(--primary);
    text-decoration: none;
}

.publication-link a:hover {
    text-decoration: underline;
}

/* News List */
.news-list {
    padding: 0;
    margin: 0;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-date {
    font-weight: 600;
    font-size: 0.75rem;
    min-width: 70px;
    flex-shrink: 0;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    text-align: center;
    white-space: nowrap;
}

/* News badge colors by offer type */
.news-date.phd { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }
.news-date.internship { background: var(--primary-subtle); color: var(--primary); }
.news-date.job { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.news-date.other { background: var(--bg-tertiary); color: var(--text-secondary); }
.news-date.website { background: #FFD700; color: #8B0000; }

[data-theme="dark"] .news-date.phd { background: rgba(139, 92, 246, 0.25); color: #a78bfa; }
[data-theme="dark"] .news-date.internship { background: var(--primary-subtle); color: var(--primary); }
[data-theme="dark"] .news-date.job { background: rgba(40, 167, 69, 0.25); color: #5fd87a; }
[data-theme="dark"] .news-date.other { background: var(--bg-tertiary); color: var(--text-muted); }
[data-theme="dark"] .news-date.website { background: #FFD700; color: #8B0000; }

.news-text {
    margin: 0;
    text-align: justify;
    flex: 1;
}

/* News Icon */
.news-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    background-color: #f59e0b;
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.8em;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* News Badge */
.news-title {
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-badge {
    height: 47px;
    width: auto;
}

/* Dark Gray Titles */
.title-dark-gray {
    color: #374151 !important;
}

[data-theme="dark"] .title-dark-gray {
    color: #9ca3af !important;
}

/* No Border for specific titles */
.no-border {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Links inside dark gray titles */
.title-dark-gray a {
    color: #374151 !important;
}

[data-theme="dark"] .title-dark-gray a {
    color: #9ca3af !important;
}

/* ============================================
   Contact Page Styles
   ============================================ */
.contact-intro {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.contact-form-container {
    width: 100%;
}

.contact-form {
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.form-group-inline .form-label {
    min-width: 100px;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.form-group-inline .form-field {
    flex: 1;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.form-label .required {
    color: #ef4444;
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.valid {
    border-color: #10b981;
}

.form-input.invalid {
    border-color: #ef4444;
}

.form-textarea {
    resize: vertical;
    min-height: 150px;
}

.form-error {
    display: block;
    margin-top: var(--spacing-xs);
    color: #ef4444;
    font-size: 0.875rem;
}

.char-count {
    display: block;
    margin-top: var(--spacing-xs);
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-actions {
    margin-top: var(--spacing-xl);
    text-align: center;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-submit:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-submit:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.form-message {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    color: #10b981;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.contact-alternative {
    margin-top: var(--spacing-xl);
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.contact-alternative .email-link {
    color: var(--primary);
    font-weight: 600;
}

.contact-alternative .email-link:hover {
    text-decoration: underline;
}

/* Dark mode adjustments */
[data-theme="dark"] .form-input {
    background: var(--bg-secondary);
}

[data-theme="dark"] .form-input:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
