/* Variables de couleurs et polices */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #27ae60;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* En-tête */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(44, 62, 80, 0.1);
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Sections principales */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.translator-section {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.translator-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(52, 152, 219, 0.2);
}

/* Formulaires */
.translator-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.translate-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.translate-btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.translate-btn:active {
    transform: scale(0.98);
}

/* Zone de résultat */
.output-container {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
}

.output-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.output-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    word-break: break-all;
    min-height: 1.5rem;
}

/* Séparateur */
.divider {
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(52, 152, 219, 0.5), transparent);
    margin: 1rem 0;
}

/* Pied de page */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(44, 62, 80, 0.1);
    font-size: 0.9rem;
    color: var(--secondary-color);
    opacity: 0.8;
}

.morse-text {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
}

/* Responsive */
@media (min-width: 768px) {
    main {
        flex-direction: row;
    }
    
    .translator-section {
        flex: 1;
    }
    
    .divider {
        width: 2px;
        height: auto;
        background: linear-gradient(to bottom, transparent, rgba(52, 152, 219, 0.5), transparent);
        margin: 0 1rem;
    }
}

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

.output-text:not(:empty) {
    animation: fadeIn 0.5s ease-out;
}

/* Style pour le texte Morse */
#outputMorse {
    letter-spacing: 2px;
}

/* Effet de focus sur les sections */
.translator-section:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.15);
}