/* ============================================
   ADMIN - FORMULAIRE STAGE
   Styles spécifiques pour le formulaire de création/modification de stage
   ============================================ */

/* ============================================
   CONTENEUR PRINCIPAL
   ============================================ */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
    background: #f8f9fa;
    margin-top: 70px;
}

.dashboard-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e9ecef;
    padding: 20px 0;
    flex-shrink: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.dashboard-content {
    flex: 1;
    padding: 30px 35px 50px;
    max-width: calc(100% - 280px);
}

/* ============================================
   EN-TÊTE
   ============================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-title {
    font-size: 24px;
    font-weight: 700;
    color: #0F2E5C;
    margin: 0;
}

.dashboard-title i {
    color: #FF6B00;
    margin-right: 10px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

.dashboard-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dashboard-actions .btn-outline {
    background: transparent;
    color: #0F2E5C;
    border: 1px solid #ced4da;
}

.dashboard-actions .btn-outline:hover {
    background: #f8f9fa;
}

/* ============================================
   ALERTES
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert i {
    font-size: 18px;
}

/* ============================================
   CARTE DU FORMULAIRE
   ============================================ */
.form-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 35px 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

/* ============================================
   GRILLE DU FORMULAIRE
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px 40px;
}

.form-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ============================================
   GROUPES DE CHAMPS
   ============================================ */
.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group .required {
    color: #dc3545;
    margin-left: 2px;
}

/* ============================================
   CHAMPS DE SAISIE
   ============================================ */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
    color: #212529;
}

.form-control:focus {
    border-color: #0057A3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 87, 163, 0.10);
}

.form-control::placeholder {
    color: #adb5bd;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

textarea.form-control#program {
    min-height: 180px;
    font-family: 'Inter', monospace;
}

/* ============================================
   LIGNE DE CHAMPS (2 colonnes)
   ============================================ */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row .form-group {
    margin-bottom: 0;
}

/* ============================================
   INDICATEURS D'AIDE
   ============================================ */
.form-hint {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* ============================================
   TOGGLE SWITCH (Mise en avant)
   ============================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
}

.toggle-switch input {
    display: none;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: #ced4da;
    border-radius: 20px;
    padding: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
}

.toggle-label .toggle-on,
.toggle-label .toggle-off {
    padding: 4px 14px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.toggle-label .toggle-on {
    background: #28a745;
    color: #fff;
    opacity: 0;
}

.toggle-label .toggle-off {
    background: transparent;
    color: #6c757d;
    opacity: 1;
}

.toggle-switch input:checked + .toggle-label {
    background: #28a745;
}

.toggle-switch input:checked + .toggle-label .toggle-on {
    opacity: 1;
}

.toggle-switch input:checked + .toggle-label .toggle-off {
    opacity: 0;
}

/* ============================================
   UPLOAD D'IMAGE
   ============================================ */
.file-upload-wrapper {
    position: relative;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-size: 14px;
    background: #f8f9fa;
}

.file-upload-label:hover {
    border-color: #0057A3;
    background: #e9ecef;
}

.file-upload-label i {
    font-size: 28px;
    color: #FF6B00;
}

.current-image {
    margin-top: 14px;
}

.current-image img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    object-fit: cover;
}

.current-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* ============================================
   BOUTONS D'ACTION
   ============================================ */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.form-actions .btn-primary {
    background: #FF6B00;
    color: #ffffff;
}

.form-actions .btn-primary:hover {
    background: #e05a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.30);
}

.form-actions .btn-outline {
    background: transparent;
    color: #0F2E5C;
    border: 1px solid #ced4da;
}

.form-actions .btn-outline:hover {
    background: #f8f9fa;
}

/* ============================================
   SELECT
   ============================================ */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-content {
        max-width: 100%;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
        margin-top: 60px;
    }
    
    .dashboard-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        position: static;
        height: auto;
    }
    
    .dashboard-content {
        max-width: 100%;
        padding: 16px;
    }
    
    .form-card {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 16px;
    }
    
    .form-row .form-group:last-child {
        margin-bottom: 0;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-card {
        padding: 16px;
    }
    
    .file-upload-label {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
}