/**
 * CPFA Core Frontend Styles
 * 
 * @package CpfaCore
 */

/* ========================================
   Variables CSS globales
   ======================================== */
:root {
    --cpfa-primary: #2c5aa0;
    --cpfa-secondary: #f8f9fa;
    --cpfa-accent: #28a745;
    --cpfa-danger: #dc3545;
    --cpfa-warning: #ffc107;
    --cpfa-info: #17a2b8;
    --cpfa-dark: #343a40;
    --cpfa-light: #f8f9fa;
    --cpfa-border-radius: 8px;
    --cpfa-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --cpfa-transition: all 0.3s ease;
    --cpfa-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========================================
   Styles de base pour les CPT
   ======================================== */
.cpfa-formation,
.cpfa-seminaire,
.cpfa-concours,
.cpfa-ressource {
    font-family: var(--cpfa-font-family);
}

/* En-tête des CPT */
.cpfa-post-header {
    margin-bottom: 2rem;
}

.cpfa-post-title {
    color: var(--cpfa-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cpfa-post-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

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

.cpfa-meta-icon {
    color: var(--cpfa-primary);
}

/* Prix et informations */
.cpfa-price-box {
    background: var(--cpfa-light);
    padding: 1.5rem;
    border-radius: var(--cpfa-border-radius);
    border-left: 4px solid var(--cpfa-accent);
    margin: 1.5rem 0;
}

.cpfa-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cpfa-accent);
}

.cpfa-price-label {
    color: #666;
    font-size: 0.9rem;
}

/* Badges et étiquettes */
.cpfa-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.cpfa-badge-primary {
    background: var(--cpfa-primary);
    color: white;
}

.cpfa-badge-success {
    background: var(--cpfa-accent);
    color: white;
}

.cpfa-badge-warning {
    background: var(--cpfa-warning);
    color: #333;
}

.cpfa-badge-danger {
    background: var(--cpfa-danger);
    color: white;
}

.cpfa-badge-info {
    background: var(--cpfa-info);
    color: white;
}

/* Boutons */
.cpfa-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--cpfa-border-radius);
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: var(--cpfa-transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.cpfa-btn-primary {
    background: var(--cpfa-primary);
    color: white;
}

.cpfa-btn-primary:hover {
    background: #1e4070;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.cpfa-btn-success {
    background: var(--cpfa-accent);
    color: white;
}

.cpfa-btn-success:hover {
    background: #1e7e34;
    transform: translateY(-2px);
}

.cpfa-btn-outline {
    background: transparent;
    border: 2px solid var(--cpfa-primary);
    color: var(--cpfa-primary);
}

.cpfa-btn-outline:hover {
    background: var(--cpfa-primary);
    color: white;
}

/* Cartes */
.cpfa-card {
    background: white;
    border-radius: var(--cpfa-border-radius);
    box-shadow: var(--cpfa-box-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.cpfa-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--cpfa-primary);
    margin-bottom: 1rem;
}

.cpfa-card-body {
    line-height: 1.6;
}

/* Listes */
.cpfa-list {
    list-style: none;
    padding: 0;
}

.cpfa-list-item {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cpfa-list-item:last-child {
    border-bottom: none;
}

.cpfa-list-icon {
    color: var(--cpfa-accent);
    font-size: 1.2rem;
}

/* Tableaux */
.cpfa-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.cpfa-table th,
.cpfa-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cpfa-table th {
    background: var(--cpfa-light);
    font-weight: 600;
    color: var(--cpfa-dark);
}

.cpfa-table tr:hover {
    background: var(--cpfa-secondary);
}

/* Alertes */
.cpfa-alert {
    padding: 1rem 1.5rem;
    border-radius: var(--cpfa-border-radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.cpfa-alert-success {
    background: #d4edda;
    border-left-color: var(--cpfa-accent);
    color: #155724;
}

.cpfa-alert-warning {
    background: #fff3cd;
    border-left-color: var(--cpfa-warning);
    color: #856404;
}

.cpfa-alert-danger {
    background: #f8d7da;
    border-left-color: var(--cpfa-danger);
    color: #721c24;
}

.cpfa-alert-info {
    background: #d1ecf1;
    border-left-color: var(--cpfa-info);
    color: #0c5460;
}

/* Tabs/Onglets */
.cpfa-tabs {
    margin-bottom: 2rem;
}

.cpfa-tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 1.5rem;
}

.cpfa-tab-link {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 500;
    transition: var(--cpfa-transition);
    border-bottom: 3px solid transparent;
}

.cpfa-tab-link:hover {
    color: var(--cpfa-primary);
}

.cpfa-tab-link.active {
    color: var(--cpfa-primary);
    border-bottom-color: var(--cpfa-primary);
}

.cpfa-tab-content {
    display: none;
}

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

/* Formulaires */
.cpfa-form-group {
    margin-bottom: 1.5rem;
}

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

.cpfa-form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--cpfa-border-radius);
    font-size: 1rem;
    transition: var(--cpfa-transition);
}

.cpfa-form-control:focus {
    outline: none;
    border-color: var(--cpfa-primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* Pagination */
.cpfa-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.cpfa-page-link {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--cpfa-border-radius);
    text-decoration: none;
    color: var(--cpfa-primary);
    transition: var(--cpfa-transition);
}

.cpfa-page-link:hover,
.cpfa-page-link.active {
    background: var(--cpfa-primary);
    color: white;
    border-color: var(--cpfa-primary);
}

/* Loader/Spinner */
.cpfa-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(44, 90, 160, 0.2);
    border-top-color: var(--cpfa-primary);
    border-radius: 50%;
    animation: cpfa-spin 1s linear infinite;
}

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

/* Messages de statut */
.cpfa-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.cpfa-status-active {
    background: #d4edda;
    color: #155724;
}

.cpfa-status-pending {
    background: #fff3cd;
    color: #856404;
}

.cpfa-status-expired {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .cpfa-post-title {
        font-size: 1.5rem;
    }
    
    .cpfa-post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cpfa-tabs-nav {
        flex-direction: column;
    }
    
    .cpfa-table {
        font-size: 0.9rem;
    }
    
    .cpfa-table th,
    .cpfa-table td {
        padding: 0.5rem;
    }
}

/* Accessibilité */
.cpfa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --cpfa-secondary: #2d3748;
        --cpfa-light: #374151;
        --cpfa-dark: #e5e7eb;
    }
    
    .cpfa-card {
        background: var(--cpfa-secondary);
        color: white;
    }
    
    .cpfa-table th {
        background: var(--cpfa-light);
        color: white;
    }
    
    .cpfa-form-control {
        background: var(--cpfa-secondary);
        color: white;
        border-color: #4a5568;
    }
}

/* Print styles */
@media print {
    .cpfa-btn,
    .cpfa-pagination {
        display: none;
    }
    
    .cpfa-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
