/* Styles pour le générateur Lorem Ipsum */
.lorem-ipsum-generator {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Formulaire */
.lorem-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Checkboxes */
.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

/* Bouton de génération */
.btn-generate {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-generate:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
}

.btn-generate:active {
    transform: translateY(0);
}

/* Résultat */
.lorem-result {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.result-header {
    background: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-copy {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-copy.copied {
    background: #6c757d;
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.lorem-content {
    padding: 2rem;
    min-height: 200px;
    background: #fff;
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
    cursor: text;
    user-select: text;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.lorem-content:focus {
    outline: none;
    background: #fafbfc;
}

.lorem-content h1,
.lorem-content h2,
.lorem-content h3,
.lorem-content h4,
.lorem-content h5,
.lorem-content h6 {
    color: #fff;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.lorem-content h1 { font-size: 2rem; }
.lorem-content h2 { font-size: 1.75rem; }
.lorem-content h3 { font-size: 1.5rem; }
.lorem-content h4 { font-size: 1.25rem; }
.lorem-content h5 { font-size: 1.1rem; }
.lorem-content h6 { font-size: 1rem; }

.lorem-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.lorem-content ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.lorem-content li {
    margin-bottom: 0.5rem;
}

.lorem-content strong {
    font-weight: 700;
    color: #fff;
}

/* Loader */
.lorem-loading {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lorem-loading p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* Compteur de caractères */
.char-count {
    background: #e9ecef;
    color: #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 1rem;
    text-align: center;
}

/* Messages d'aide */
.help-text {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .lorem-ipsum-generator {
        padding: 0 1rem;
    }
    
    .lorem-form {
        padding: 1.5rem;
    }
    
    .result-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-copy {
        width: 100%;
        justify-content: center;
    }
    
    .lorem-content {
        padding: 1.5rem;
        font-size: 0.95rem;
    }
    
    .lorem-content h1 { font-size: 1.75rem; }
    .lorem-content h2 { font-size: 1.5rem; }
    .lorem-content h3 { font-size: 1.25rem; }
    .lorem-content h4 { font-size: 1.1rem; }
    .lorem-content h5 { font-size: 1rem; }
    .lorem-content h6 { font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .lorem-form {
        padding: 1rem;
    }
    
    .lorem-content {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .btn-generate {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Animations d'entrée */
.lorem-result {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* États de focus améliorés */
.form-control:focus,
.btn-generate:focus,
.btn-copy:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .spinner,
    .btn-generate,
    .btn-copy,
    .lorem-result {
        animation: none;
        transition: none;
    }
}

/* Mode sombre (si supporté) */
@media (prefers-color-scheme: dark) {
    .lorem-ipsum-generator {
        color: #e9ecef;
    }
    
    .lorem-form {
        background: #2d3748;
        color: #e9ecef;
    }
    
    .form-control {
        background: #4a5568;
        border-color: #718096;
        color: #e9ecef;
    }
    
    .form-control:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
    }
    
    .lorem-result {
        background: #2d3748;
        border-color: #718096;
    }
    
    .result-header {
        background: #4a5568;
        border-color: #718096;
    }
    
    .lorem-content {
        background: #2d3748;
        color: #e9ecef;
    }
    
    .lorem-loading {
        background: #4a5568;
        border-color: #718096;
    }
}
