/* style.css - FORMAGUIDE
   Version complète avec styles publics ET admin
*/

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* ==============================================
   STYLES PUBLICS (site visible par tous)
   ============================================== */

.container.public {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* Header public */
.public-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 14px;
    opacity: 0.9;
}

.btn-admin-link {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-admin-link:hover {
    background: rgba(255,255,255,0.3);
}

/* Bannière héros */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
    margin: 0;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
}

/* Barre d'outils publique */
.toolbar {
    padding: 20px 40px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.search-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    flex: 2;
    display: flex;
    min-width: 250px;
}

.search-input-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px 0 0 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-search {
    background: #667eea;
    border: none;
    padding: 0 20px;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    font-size: 18px;
    color: white;
    transition: all 0.3s;
}

.btn-search:hover {
    background: #5a67d8;
}

.search-form select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-view {
    background: #17a2b8;
    color: white;
    flex: 1;
    text-align: center;
    justify-content: center;
}

.btn-view:hover {
    background: #138496;
}

/* Navigation par catégories */
.categories-nav {
    padding: 15px 40px;
    background: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.cat-tag {
    background: white;
    padding: 6px 15px;
    border-radius: 25px;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid #667eea;
    transition: all 0.3s;
}

.cat-tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.cat-tag .count {
    font-size: 11px;
    opacity: 0.7;
}

/* Résultats */
.results-info {
    padding: 15px 40px;
    background: #e9ecef;
    color: #495057;
    font-size: 14px;
}

/* Grille des formations publiques */
.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 40px;
}

.formation-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.formation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

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

.categorie-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.format-badge {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.formation-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.sous-titre-card {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.sous-categorie {
    font-size: 12px;
    color: #999;
    margin-bottom: 15px;
}

.card-details {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #555;
}

.duration, .price {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-actions {
    margin-top: 15px;
}

/* Fiche détaillée publique */
.fiche {
    background: #f8f9fa;
    margin: 20px;
    border-radius: 20px;
    overflow: hidden;
}

.fiche-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
}

.fiche-header .badges {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.reference {
    font-family: monospace;
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.fiche-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.sous-titre {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.categorie-path {
    font-size: 14px;
    opacity: 0.8;
}

.fiche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 30px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.info-card h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.info-card p {
    line-height: 1.6;
    color: #555;
}

.programme {
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
}

/* CTA contact */
.contact-cta {
    background: #f8f9fa;
    text-align: center;
    padding: 40px;
    margin: 20px;
    border-radius: 20px;
    border: 2px solid #e0e0e0;
}

.contact-cta h3 {
    color: #333;
    margin-bottom: 10px;
}

.contact-cta p {
    color: #666;
    margin-bottom: 20px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer public */
.public-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 40px;
}

.public-footer p {
    margin: 5px 0;
}

/* Back link */
.back-link {
    display: inline-block;
    margin: 20px 0 0 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.btn-admin-small {
    display: inline-block;
    margin: 20px 20px 0 0;
    background: #dc3545;
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    float: right;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    margin: 40px;
    border-radius: 20px;
}

.empty-state p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

/* ==============================================
   STYLES ADMIN (interface d'administration)
   ============================================== */

.container.admin {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    padding: 20px;
}

.admin-header {
    background: #dc3545;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-header h1 {
    font-size: 24px;
}

.admin-links {
    display: flex;
    gap: 10px;
}

/* Tableau admin */
.formations-table {
    overflow-x: auto;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

tr:hover {
    background: #f8f9fa;
}

.badge {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
}

.status-active {
    color: #28a745;
    font-weight: bold;
}

.status-inactive {
    color: #dc3545;
}

.actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-small.edit {
    background: #ffc107;
    color: #333;
}

.btn-small.edit:hover {
    background: #e0a800;
}

.btn-small.delete {
    background: #dc3545;
    color: white;
}

.btn-small.delete:hover {
    background: #c82333;
}

/* Formulaire admin */
.formation-form {
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 25px;
}

.form-section h2 {
    color: #667eea;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group textarea {
    resize: vertical;
}

.checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox input {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .formations-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .toolbar {
        padding: 20px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .search-form select {
        width: 100%;
    }
    
    .categories-nav {
        padding: 15px 20px;
    }
    
    .fiche-header {
        padding: 20px;
    }
    
    .fiche-header h2 {
        font-size: 24px;
    }
    
    .fiche-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    th, td {
        padding: 8px;
        font-size: 12px;
    }
    
    .actions {
        flex-direction: column;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.formation-card, .info-card {
    animation: fadeIn 0.5s ease-out;
}