/* === PAGE CONVERTISSEUR DÉCIMAL/BINAIRE - CSS OPTIMISÉ === */

/* Header de la page convertisseur */
.page-header.cours-particuliers-header {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 120px 0 80px;
    position: relative;
    color: white;
    text-align: center;
}

.page-header.cours-particuliers-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.page-header .header-content {
    position: relative;
    z-index: 2;
}

.page-header .page-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.page-header .page-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Section d'explication */
.explanation-section {
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 2px 12px #e0e7ef;
    padding: 32px 24px;
    max-width: 900px;
    margin: 40px auto 0 auto;
    transition: all 0.3s ease;
}

.explanation-section:hover {
    box-shadow: 0 4px 20px #e0e7ef;
}

.explanation-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #3b3b5c;
    text-align: center;
    font-weight: 700;
}

.explanation-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.base-explanation {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.base-explanation:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.base-explanation h3 {
    color: #6366f1;
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.base-explanation p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 8px;
}

.base-explanation p:last-child {
    margin-bottom: 0;
}

.base-explanation strong {
    color: #3b3b5c;
    font-weight: 600;
}

/* Section de conversion */
.converter-section {
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 2px 12px #e0e7ef;
    padding: 32px 24px;
    max-width: 600px;
    margin: 40px auto 0 auto;
    transition: all 0.3s ease;
}

.converter-section:hover {
    box-shadow: 0 4px 20px #e0e7ef;
}

.converter-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #3b3b5c;
    text-align: center;
    font-weight: 700;
}

.converter-section p {
    color: #555;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Formulaire de conversion */
#converter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #1e293b;
    font-size: 1rem;
}

.input-group input[type="text"] {
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1.1rem;
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px #e0e7ef33;
    font-family: 'Courier New', monospace;
    text-align: center;
}

.input-group input[type="text"]:focus {
    border: 1.5px solid #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-group input[type="text"]:valid {
    border-color: #10b981;
}

.input-group input[type="text"]:invalid {
    border-color: #ef4444;
}

/* Bouton de conversion */
#convert-btn {
    background: linear-gradient(90deg, #6366f1, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 0;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 2px 8px #c7d2fe55;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#convert-btn:hover {
    background: linear-gradient(90deg, #764ba2, #6366f1);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px #c7d2fe55;
}

#convert-btn:active {
    transform: translateY(0);
}

/* Résultat de conversion */
#conversion-result {
    margin-top: 24px;
    text-align: center;
}

.result-card {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    transition: all 0.3s ease;
}

.result-card:hover {
    background: #e0f2fe;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.result-card h3 {
    color: #0369a1;
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.result-value {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0c4a6e;
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #7dd3fc;
    display: inline-block;
    margin: 8px 0;
}

.result-explanation {
    color: #555;
    font-size: 0.95rem;
    margin-top: 8px;
    line-height: 1.4;
}

/* Section d'exemples */
.examples-section {
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 2px 12px #e0e7ef;
    padding: 32px 24px;
    max-width: 900px;
    margin: 40px auto 0 auto;
    transition: all 0.3s ease;
}

.examples-section:hover {
    box-shadow: 0 4px 20px #e0e7ef;
}

.examples-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #3b3b5c;
    text-align: center;
    font-weight: 700;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.example-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    text-align: center;
}

.example-card:hover {
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.example-card h4 {
    color: #6366f1;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.example-card p {
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}

.example-card p:last-child {
    margin-bottom: 0;
}

.example-card strong {
    color: #3b3b5c;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Messages d'erreur */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header .page-title {
        font-size: 2.5rem;
    }
    
    .page-header .page-subtitle {
        font-size: 1.2rem;
    }
    
    .explanation-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .explanation-section,
    .converter-section,
    .examples-section {
        margin: 20px 16px 0 16px;
        padding: 24px 16px;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .result-value {
        font-size: 1.3rem;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .page-header .page-title {
        font-size: 2rem;
    }
    
    .page-header .page-subtitle {
        font-size: 1rem;
    }
    
    .explanation-section h2,
    .converter-section h2,
    .examples-section h2 {
        font-size: 1.6rem;
    }
    
    .base-explanation h3 {
        font-size: 1.1rem;
    }
    
    .input-group input[type="text"] {
        font-size: 1rem;
        padding: 10px 12px;
    }
    
    #convert-btn {
        padding: 12px 0;
        font-size: 1rem;
    }
    
    .result-value {
        font-size: 1.2rem;
    }
}




