/* =============================================
   FLEXCAMPUS - CATALOGUE FORMATIONS
   ============================================= */

:root {
    --primary: #0d3865;
    --primary-dark: #092847;
    --primary-light: #1a4a7a;
    --secondary: #6dcbdd;
    --secondary-dark: #4fb8cc;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --border: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

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

/* =============================================
   NAVBAR
   ============================================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon { font-size: 28px; }

.brand-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-link:hover { color: var(--primary); background: var(--gray-50); }

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-link.btn-login {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 8px 20px;
}

.nav-link.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(109, 203, 221, 0.4);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-600);
    border-radius: 1px;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 8px 24px 16px;
    border-top: 1px solid var(--border);
}

.mobile-menu.open { display: flex; }

.mobile-link {
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
}

.mobile-link.active { color: var(--primary); font-weight: 600; }

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

.catalog-hero {
    padding: 120px 24px 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #1e5a99 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.catalog-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(109, 203, 221, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.catalog-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(109, 203, 221, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 36px;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 12px;
}

.hero-content p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 28px;
}

.hero-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    margin: 0 auto;
}

.hero-search svg { color: var(--gray-400); flex-shrink: 0; }

.hero-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: transparent;
    padding: 10px 0;
}

.hero-search input::placeholder { color: var(--gray-400); }

/* =============================================
   FILTERS BAR
   ============================================= */

.filters-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 64px;
    z-index: 100;
}

.filters-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--white);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

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

.filter-count {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 500;
    white-space: nowrap;
}

/* =============================================
   FORMATIONS GRID
   ============================================= */

.catalog-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Formation card */
.formation-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.formation-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(13, 56, 101, 0.12);
    border-color: transparent;
}

.card-banner {
    height: 140px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.card-banner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.card-niveau {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-code {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    margin-bottom: 4px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.3;
}

.card-body {
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-description {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {
    display: flex;
    gap: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.card-stat-icon {
    font-size: 16px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-duration {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 500;
}

.card-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    transition: gap 0.2s;
}

.formation-card:hover .card-cta { gap: 10px; }

/* =============================================
   FORMATION MODAL
   ============================================= */

.formation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.formation-modal.open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: var(--gray-600);
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-close:hover {
    background: var(--white);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-header {
    padding: 32px 32px 24px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.modal-header-code {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
    margin-bottom: 4px;
}

.modal-header-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}

.modal-header-desc {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.7;
    position: relative;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.modal-stat {
    background: var(--white);
    padding: 16px;
    text-align: center;
}

.modal-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.modal-stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.modal-body {
    padding: 24px 32px;
}

.modal-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
}

/* Roadmap */
.roadmap {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.roadmap::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.roadmap-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    position: relative;
}

.roadmap-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    border: 3px solid var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.roadmap-info {
    flex: 1;
    padding-top: 8px;
}

.roadmap-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
}

.roadmap-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.btn-enroll {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--primary-dark);
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-enroll:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(109, 203, 221, 0.4);
}

/* =============================================
   LOADING / EMPTY
   ============================================= */

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 16px;
}

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

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

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
    font-size: 16px;
}

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

.catalog-footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--gray-400);
    font-size: 13px;
    background: var(--white);
}

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

@media (max-width: 768px) {
    .navbar-links { display: none; }
    .mobile-menu-btn { display: flex; }

    .catalog-hero { padding: 100px 20px 40px; }
    .hero-content h1 { font-size: 26px; }

    .formations-grid { grid-template-columns: 1fr; }

    .modal-content { max-height: 92vh; border-radius: var(--radius-lg); }
    .modal-header, .modal-body, .modal-footer { padding-left: 20px; padding-right: 20px; }
    .modal-stats { grid-template-columns: repeat(2, 1fr); }

    .filters-inner { flex-direction: column; align-items: flex-start; }
}

/* =============================================
   SCROLLBAR
   ============================================= */

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
