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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #3885C6;
    min-height: 100vh;
    color: #1f2937;
}

/* ==================== HEADER NAVIGATION ==================== */
.main-header {
    background: #3885C6;;
    padding: 8px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo img {
    height: 90px;
    width: auto;
}

.header-nav {
    display: flex;
    gap: 40px;
    align-items: center;
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.header-nav a:hover {
    opacity: 0.8;
}

.header-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
}

.header-admin-btn {
    background: #FDBD43;
    color: #ffffff;
    padding: 15px 28px;
    border-radius: 25px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(253, 189, 67, 0.3);
}

.header-admin-btn:hover {
    background: #ffffff;
    color : #FDBD43;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(253, 189, 67, 0.4);
}

/* Menu déroulant */
.header-nav-item {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.5s ease;
}

.header-nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 10px;
    z-index: 1001;
}

.header-nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 8px;
}

.dropdown-menu a:hover {
    color: #3885C6;
}

.dropdown-menu a.active {
    color: #3885C6;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.login-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

.login-error.show {
    display: block;
}

.login-attempts {
    text-align: center;
    color: #f59e0b;
    font-size: 0.875rem;
    margin-top: 8px;
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    text-align: center;
    color: white;
    margin-bottom: 48px;
    padding-top: 24px;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.page-header p {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.stat-value.indigo { color: #6366f1; }
.stat-value.purple { color: #8b5cf6; }
.stat-value.pink { color: #ec4899; }
.stat-value.green { color: #10b981; }
.stat-value.orange { color: #f59e0b; }
.stat-value.blue { color: #3b82f6; }

.stat-label {
    color: #6b7280;
    font-weight: 500;
}

/* ==================== SEARCH SECTION ==================== */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.main-search-input {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.main-search-input input {
    width: 100%;
    padding: 20px 20px 20px 60px;
    border: 3px solid #e5e7eb;
    border-radius: 16px;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    background: white;
}

.main-search-input input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.main-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    width: 28px;
    height: 28px;
}

/* ==================== FILTERS SECTION ==================== */
.filters-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

select, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ==================== BUTTONS ==================== */
.clear-btn, .btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.clear-btn {
    background: #f3f4f6;
    color: #374151;
    align-self: end;
    height: 50px;
}

.clear-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: #e0e7ff;
    color: #4338ca;
}

.btn-secondary:hover {
    background: #c7d2fe;
}

.btn-delete {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: #fecaca;
}

/* ==================== FORMATIONS GRID ==================== */
.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.formation-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.formation-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.15);
}

.formation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    border-radius: 20px 20px 0 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.year-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.company-info {
    text-align: right;
    flex-shrink: 1;
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-name {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.status-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.status-pill-green { background-color: #10b981; }
.status-pill-orange { background-color: #f59e0b; }
.status-pill-red { background-color: #ef4444; }

.employee-section {
    margin-bottom: 16px;
}

.employee-name {
    font-size: 1.125rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 4px;
}

.formations-section, .notes-section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.formations-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.formation-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
}

.notes-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.contact-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-section a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.contact-section a:hover {
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 48px 20px;
    color: white;
}

/* ==================== ADMIN SECTION ==================== */
.admin-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.admin-section h2 {
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: #111827;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.admin-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s ease;
}

.admin-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.admin-tab:hover {
    color: #4f46e5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#add-formation-form, #add-formateur-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.formations-list-item, .formateur-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    background: #f9fafb;
    margin-bottom: 12px;
}

.formations-list-item p, .formateur-card p {
    margin: 0;
}

.formations-list-item .info, .formateur-card .info {
    font-weight: 500;
}

.formations-list-item .company {
    color: #6b7280;
}

.actions {
    display: flex;
    gap: 8px;
}

/* ==================== FORMATEURS PAGE ==================== */
.formateurs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.formateur-card-display {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #6366f1;
}

.formateur-card-display:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.formateur-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.formateur-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.formateur-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #10b981;
    color: white;
}

.formateur-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6b7280;
}

.contact-item a {
    color: #6366f1;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.formateur-specialites {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.specialite-tag {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.empty-state h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    color: white;
    opacity: 0.9;
    margin-top: 48px;
    padding: 24px;
    font-size: 1rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px 24px;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    
    .formations-grid, .formateurs-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}