/**
 * WiFi Detector CSS - Styles pour le composant de détection WiFi
 */

/* Modal principal */
.wifi-input-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.wifi-input-modal .modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

/* En-tête du modal */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Formulaire */
#wifi-form {
    padding: 30px;
}

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

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

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="text"].valid {
    border-color: #27ae60;
    background-color: #f8fff9;
}

.form-group input[type="text"].invalid {
    border-color: #e74c3c;
    background-color: #fff8f8;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
    line-height: 1.4;
}

/* Gestion de la force du signal */
.signal-input {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.signal-input input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e1e8ed;
    outline: none;
    -webkit-appearance: none;
}

.signal-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.signal-input input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#signal-value {
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

/* Boutons d'action */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

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

.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: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* Messages d'erreur */
.error-message {
    background: #fee;
    color: #e74c3c;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #fcc;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    display: none;
}

/* Indicateurs de statut */
.wifi-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

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

.wifi-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.wifi-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Styles pour la gestion des réseaux */
.wifi-networks-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.networks-management {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.network-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.network-form h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
}

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

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

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #34495e;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

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

.networks-list {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.networks-list h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
}

.loading-networks {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading-networks i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.network-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.network-info h5 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.network-info p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

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

.network-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.network-actions .btn-edit {
    background: #3498db;
    color: white;
}

.network-actions .btn-delete {
    background: #e74c3c;
    color: white;
}

.network-actions .btn-toggle {
    background: #27ae60;
    color: white;
}

.network-actions .btn-toggle.inactive {
    background: #95a5a6;
}

/* Styles pour le bouton de préremplissage */
.btn-info {
    background: #17a2b8;
    color: white;
}

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

/* Animation pour les champs préremplis */
@keyframes highlightField {
    0% { background-color: white; border-color: #ddd; }
    50% { background-color: #e8f5e8; border-color: #4caf50; }
    100% { background-color: white; border-color: #ddd; }
}

.field-prefilled {
    animation: highlightField 3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .networks-management {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Icônes WiFi */
.wifi-icon {
    font-size: 1.2em;
}

.wifi-icon.connected {
    color: #27ae60;
}

.wifi-icon.disconnected {
    color: #e74c3c;
}

.wifi-icon.weak {
    color: #f39c12;
}

/* Responsive */
@media (max-width: 768px) {
    .wifi-input-modal .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .signal-input {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    #signal-value {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .modal-header h3 {
        font-size: 1.3em;
    }
    
    #wifi-form {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* États de chargement */
.wifi-detector.loading {
    position: relative;
}

.wifi-detector.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.wifi-detector.loading::before {
    content: '🔄';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Styles pour l'intégration dans le dashboard */
.wifi-validation-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wifi-validation-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wifi-network-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.wifi-network-info .network-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.wifi-network-info .network-details {
    color: #6c757d;
    font-size: 14px;
}

.wifi-validation-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.wifi-validation-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Styles pour la gestion des réseaux */
.networks-management {
    margin-top: 20px;
}

.network-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.network-form h4 {
    color: #495057;
    margin-bottom: 10px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    font-size: 1.3em;
}

.form-subtitle {
    color: #6c757d;
    margin-bottom: 20px;
    font-style: italic;
}

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

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #007bff;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    transform: translateY(-1px);
}

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

.form-text {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
    line-height: 1.4;
}

.form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.form-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.form-info i {
    color: #007bff;
    font-size: 1.1em;
    margin-top: 2px;
}

.form-info span {
    color: #004085;
    line-height: 1.5;
}

.form-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

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

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

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

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.networks-list {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.networks-list h4 {
    color: #495057;
    margin-bottom: 20px;
    border-bottom: 2px solid #28a745;
    padding-bottom: 10px;
    font-size: 1.3em;
}

.loading-networks {
    text-align: center;
    color: #6c757d;
    padding: 30px;
}

.loading-networks i {
    margin-right: 10px;
    color: #007bff;
    font-size: 1.2em;
}

/* Animation pour les champs préremplis */
@keyframes highlightField {
    0% { background-color: #fff3cd; }
    50% { background-color: #ffeaa7; }
    100% { background-color: white; }
}

.field-prefilled {
    animation: highlightField 2s ease-in-out;
}

/* Responsive design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}
