/* Palette de couleurs suisses (tons rouges, modernes) */
:root {
    --primary-red: #c8102e;      /* Rouge suisse (croix suisse) */
    --dark-red: #8b0a1a;         /* Rouge foncé */
    --light-red: #f5e6e8;        /* Fond très clair */
    --accent-white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #e0e0e0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fafafa;
}

/* Navigation */
header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 0.5rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
    cursor: pointer;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav li {
    position: relative;
}

nav a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-block;
}

nav a:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
}

nav a.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Section des filtres */
.filters-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h3 {
    color: var(--dark-red);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-red);
}

.checkbox-item label {
    cursor: pointer;
    user-select: none;
}

/* Grille des cartes */
.bioinformaticians-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    min-height: 400px;
    position: relative;
    transition: opacity 0.2s ease;
}

.bioinformaticians-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Animation d'apparition des cartes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Carte bioinformaticien */
.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 5px solid var(--primary-red);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    animation: fadeInUp 0.5s ease-out;
}

.card:hover {
    transform: translateY(-4px) translateX(4px);
    box-shadow: 0 12px 24px rgba(200, 16, 46, 0.2);
    border-left-width: 8px;
}

.card-header {
    background: linear-gradient(135deg, var(--light-red) 0%, #f9f1f3 100%);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    max-width: 200px;
    border-right: 2px solid rgba(200, 16, 46, 0.1);
    transition: background 0.3s ease;
}

.card:hover .card-header {
    background: linear-gradient(135deg, var(--light-red) 0%, #ffe8ec 100%);
}

.card-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 4px solid var(--primary-red);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover .card-image {
    transform: scale(1.05);
    border-color: var(--dark-red);
    box-shadow: 0 6px 16px rgba(200, 16, 46, 0.3);
}
    border: 4px solid var(--primary-red);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.2);
}

.card-image-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.2);
}

.card-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--dark-red);
    margin: 0.5rem 0;
    text-align: center;
    line-height: 1.3;
}

.card-role {
    color: var(--text-light);
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.3;
}

.services-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(200, 16, 46, 0.15);
}

.service-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-advice {
    background: #e3f2fd;
    color: #1565c0;
    border-color: #1565c0;
}

.service-collaboration {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #2e7d32;
}

.service-mentoring {
    background: #fff3e0;
    color: #e65100;
    border-color: #e65100;
}

.card-body {
    flex: 1;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-content: start;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.info-row.full-width {
    grid-column: 1 / -1;
}

.info-label {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--text-dark);
    margin-top: 0.25rem;
    word-break: break-word;
}

.card-footer {
    padding: 2rem 2rem 2rem 1.5rem;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

/* Animation de pulsation pour le bouton Contact */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(200, 16, 46, 0);
    }
}

.btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-email {
    background: var(--primary-red);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-email:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(200, 16, 46, 0.3);
    animation: pulse 1.5s infinite;
}

/* Page d'inscription */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-container h1 {
    color: var(--dark-red);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
    transform: translateY(-2px);
}

/* États de validation */
.form-group input.success,
.form-group textarea.success {
    border-color: #28a745;
    background-color: #f0fff4;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

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

.form-group small {
    display: block;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.required {
    color: var(--primary-red);
}

.form-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-submit {
    background: var(--primary-red);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-submit:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(200, 16, 46, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-cancel {
    background: var(--text-light);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-cancel:hover {
    background: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#filterStatus {
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(200, 16, 46, 0.05) 0%, rgba(139, 10, 26, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

#filterStatus #resultCount {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
footer {
    background: var(--dark-red);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Contact Popup */
.contact-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.contact-popup-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.contact-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.contact-popup-close:hover {
    background: var(--light-red);
    color: var(--primary-red);
}

.contact-popup h3 {
    color: var(--dark-red);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item strong {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.contact-link {
    color: var(--primary-red);
    text-decoration: none;
    padding: 0.5rem;
    background: var(--light-red);
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    word-break: break-all;
}

.contact-link:hover {
    background: var(--primary-red);
    color: white;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-links strong {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.contact-links div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-contact {
    cursor: pointer;
    border: none;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-red);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background: var(--dark-red);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(200, 16, 46, 0.4);
}

.back-to-top.show {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10001;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

/* Responsive */
@media (max-width: 768px) {
    .bioinformaticians-grid {
        grid-template-columns: 1fr;
    }

    .card {
        flex-direction: column;
    }

    .card-header {
        max-width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 2px solid rgba(200, 16, 46, 0.1);
    }

    .card-body {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .card-footer {
        min-width: 100%;
        padding: 1.5rem;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    header {
        padding: 1rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    .container {
        padding: 1rem;
    }
}
