/* CSS spécifique pour la page Cramer */

/* Navigation active */
nav a.active {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.4);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.2);
}

nav a.active::after {
    height: 100%;
}

/* Container principal Cramer */
#cramer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Card d'explication */
.explanation-card {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: 15px;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.explanation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ff88, #00cc66, #004d1a, #00ff88);
    background-size: 200% 100%;
    animation: gradientFlow 3s ease-in-out infinite;
}

.explanation-card h2 {
    color: #00ff88;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
}

.explanation-card p {
    color: #cbd5e0;
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.equation-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: #f7fafc;
    background: rgba(15, 15, 35, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.equation-line {
    text-align: center;
    letter-spacing: 1px;
}

/* Section de saisie */
.input-section {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 15px;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.matrix-container h3 {
    color: #00ff88;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
}

/* Grille de la matrice */
.matrix-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.matrix-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Groupes d'input */
.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.input-group label {
    color: #00ff88;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 0 1px 5px rgba(0, 255, 136, 0.3);
}

.input-group input {
    width: 70px;
    height: 45px;
    background: rgba(15, 15, 35, 0.8);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    color: #f7fafc;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.input-group input:focus {
    outline: none;
    border-color: #00ff88;
    background: rgba(15, 15, 35, 0.9);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(0, 255, 136, 0.3);
    transform: scale(1.05);
}

.input-group input::placeholder {
    color: #64748b;
}

/* Variables affichées */
.variable {
    color: #cbd5e0;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.solve-button,
.clear-button,
.example-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.solve-button {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 204, 102, 0.3) 100%);
    border: 2px solid rgba(0, 255, 136, 0.4);
    color: #00ff88;
}

.clear-button {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.3) 100%);
    border: 2px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.example-button {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.3) 100%);
    border: 2px solid rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

.solve-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.3);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3) 0%, rgba(0, 204, 102, 0.4) 100%);
}

.clear-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.4) 100%);
}

.example-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.4) 100%);
}

.button-icon {
    font-size: 1.2rem;
}

/* Section des résultats */
#results-section {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 15px;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}

#results-section.results-visible {
    transform: translateY(0);
    opacity: 1;
}

.results-hidden {
    display: none;
}

#results-section h3 {
    color: #00ff88;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
}

/* Grilles des déterminants */
.determinants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.det-card {
    background: rgba(15, 15, 35, 0.7);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(0, 255, 136, 0.2);
    transition: all 0.3s ease;
}

.det-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.4);
}

.det-card h4 {
    color: #cbd5e0;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.det-value {
    color: #00ff88;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 5px rgba(0, 255, 136, 0.3);
}

/* Grille des solutions */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.solution-card {
    background: rgba(15, 15, 35, 0.7);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(0, 255, 136, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.solution-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00ff88, #00cc66);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.solution-card:hover::before {
    transform: scaleX(1);
}

.solution-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.3);
    border-color: rgba(0, 255, 136, 0.5);
}

.solution-card h4 {
    color: #f7fafc;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.solution-value {
    color: #00ff88;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
}

/* Messages d'état */
.status-message {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.status-message.warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

/* Animations d'apparition */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.solution-card {
    animation: bounceIn 0.6s ease-out;
}

.det-card {
    animation: slideInUp 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    #cramer-container {
        padding: 15px;
        gap: 20px;
    }

    .matrix-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .input-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .input-group input {
        width: 80px;
    }

    .variable {
        display: none;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .solve-button,
    .clear-button,
    .example-button {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .determinants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .solutions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}