/* Styles personnalisés pour la fiche de révision EAER */

/* Variables CSS */
:root {
    --aero-blue: #1E40AF;
    --aero-light: #3B82F6;
    --aero-dark: #1E3A8A;
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.1);
}

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

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Navigation */
.nav-btn {
    @apply px-4 py-2 rounded-lg font-medium text-gray-600 hover:text-aero-blue hover:bg-blue-50 transition-all duration-200 border-2 border-transparent;
}

.nav-btn.active {
    @apply text-white bg-aero-blue border-aero-blue shadow-md;
    animation: pulse 2s infinite;
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* Sections */
.section-content {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.section-content.active {
    display: block;
}

/* Formules */
.formula-box {
    @apply bg-white p-4 border-l-4 border-aero-blue rounded-r-lg shadow-sm;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--aero-dark);
    text-align: center;
    letter-spacing: 0.5px;
}

.formula-container {
    @apply flex justify-between items-center p-3 bg-white rounded-lg shadow-sm border-l-4 border-blue-300;
    transition: all 0.2s ease;
}

.formula-container:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-light);
    border-left-color: var(--aero-blue);
}

.formula-label {
    @apply font-medium text-gray-700;
    flex: 1;
}

.formula-text {
    @apply font-mono font-semibold text-aero-blue;
    font-size: 0.95rem;
    flex: 1;
    text-align: right;
}

/* Cartes et conteneurs */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

/* Éléments interactifs */
.interactive-element {
    transition: all 0.2s ease;
    cursor: pointer;
}

.interactive-element:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-light);
}

/* Typographie améliorée */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

h2 {
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--aero-blue), var(--aero-light));
    border-radius: 2px;
}

/* Amélioration des listes */
ul li {
    position: relative;
    padding-left: 1rem;
}

ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--aero-blue);
    font-weight: bold;
}

/* Codes couleur par section */
.flexion-theme {
    border-left-color: #3B82F6 !important;
}

.cisaillement-theme {
    border-left-color: #F59E0B !important;
}

.torsion-theme {
    border-left-color: #8B5CF6 !important;
}

.idealisation-theme {
    border-left-color: #10B981 !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .nav-btn {
        @apply text-sm px-3 py-2;
    }
    
    .formula-container {
        @apply flex-col items-start space-y-2;
    }
    
    .formula-text {
        @apply text-left;
        flex: none;
    }
    
    .grid.lg\\:grid-cols-2 {
        @apply grid-cols-1;
    }
}

/* Graphiques et visualisations */
canvas {
    border-radius: 8px;
    background: white;
    box-shadow: var(--shadow-light);
}

/* Indicateurs visuels */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-success {
    background-color: #10B981;
}

.status-warning {
    background-color: #F59E0B;
}

.status-error {
    background-color: #EF4444;
}

.status-info {
    background-color: #3B82F6;
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Mise en évidence du contenu */
.highlight-box {
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.highlight-box:hover::before {
    left: 100%;
}

/* Effets de scroll */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Amélioration de l'accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states améliorés */
button:focus,
.nav-btn:focus {
    outline: 2px solid var(--aero-light);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .nav-btn,
    canvas {
        display: none;
    }
    
    .section-content {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .formula-box {
        background: #f8f9fa !important;
        border: 1px solid #ddd !important;
    }
}

/* Thème sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
    }
    
    .dark-mode {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .dark-mode .bg-white {
        background-color: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
    }
}

/* Animations de chargement */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--aero-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Styles pour le calculateur avancé */
.calc-tab {
    transition: all 0.2s ease;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.calc-tab:hover {
    background-color: #f8fafc;
    color: var(--aero-blue);
}

.calc-tab.active {
    border-bottom-color: var(--aero-blue) !important;
    color: var(--aero-blue) !important;
    background-color: #eff6ff;
}

.calc-content {
    animation: fadeIn 0.3s ease-out;
}

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