:root {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #cffafe;
    --secondary: #06b6d4;
    --bg: #f0f9ff;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 20px;
}

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

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

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

/* Header */
header {
    text-align: center;
    margin-bottom: 48px;
    padding: 20px 0;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary.full {
    width: 100%;
    margin-top: 8px;
}

/* Coaches Grid */
.coaches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 28px;
}

.coach-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.coach-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
}

.coach-card::after {
    content: "Voir les playlists →";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px;
    transform: translateY(100%);
    transition: transform 0.25s;
}

.coach-card:hover::after {
    transform: translateY(0);
}

.coach-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 4px solid var(--primary-light);
    transition: border-color 0.2s;
}

.coach-card:hover .coach-avatar {
    border-color: var(--primary);
}

.coach-avatar-fallback {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    border: 4px solid var(--primary-light);
    transition: border-color 0.2s;
}

.coach-card:hover .coach-avatar-fallback {
    border-color: var(--primary);
}

.coach-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.coach-count {
    font-size: 0.88rem;
    color: var(--text-light);
    background: var(--bg);
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-weight: 500;
}

/* Modal / Popup */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease-out;
}

.popup-large {
    max-width: 700px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.close-btn:hover {
    background: var(--bg);
    color: var(--text);
}

/* Popup Header */
.popup-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 28px 0;
}

.popup-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-light);
    flex-shrink: 0;
}

.popup-avatar.fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.popup-info {
    flex: 1;
    min-width: 0;
}

.popup-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.popup-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Popup Filters */
.popup-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 20px 28px 0;
}

.filter-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Popup Playlists */
.popup-playlists {
    padding: 20px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.playlist-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg);
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.playlist-row:hover {
    border-color: var(--secondary);
    transform: translateX(4px);
}

.playlist-row-info {
    flex: 1;
    min-width: 0;
}

.playlist-row-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-row-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.playlist-row-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-row-platform {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.playlist-row-btn {
    background: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.playlist-row-btn:hover {
    background: var(--primary);
    color: white;
}

/* Badge */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-aquagym { background: #fef3c7; color: #92400e; }
.badge-natation { background: #dbeafe; color: #1e40af; }
.badge-bébé-nageur { background: #fce7f3; color: #9d174d; }
.badge-aquabike { background: #d1fae5; color: #065f46; }
.badge-autre { background: #f3e8ff; color: #6b21a8; }

/* Form */
form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--card);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: transform 0.3s ease-out;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }

/* Loading */
.loading {
    text-align: center;
    color: var(--text-light);
    padding: 60px;
    grid-column: 1 / -1;
}

/* Empty */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-light);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 640px) {
    h1 { font-size: 1.4rem; }

    .coaches-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .coach-card {
        padding: 20px 14px;
    }

    .coach-avatar,
    .coach-avatar-fallback {
        width: 80px;
        height: 80px;
        font-size: 1.6rem;
    }

    .coach-name {
        font-size: 0.95rem;
    }

    .coach-count {
        font-size: 0.78rem;
        padding: 3px 10px;
    }

    .popup-header {
        padding: 20px 20px 0;
        gap: 14px;
    }

    .popup-avatar,
    .popup-avatar.fallback {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }

    .popup-info h2 {
        font-size: 1.2rem;
    }

    .popup-filters {
        padding: 16px 20px 0;
    }

    .popup-playlists {
        padding: 16px 20px 20px;
    }

    .playlist-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .playlist-row-btn {
        width: 100%;
        text-align: center;
    }
}
