﻿@import url("responsive-global.css");
   /* ======================== SYSTÈME CSS INTÉGRÉ ======================== */
        @import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

        :root {
            --primary-color: #3f51b5;
            --secondary-color: #2196f3;
            --success-color: #4caf50;
            --warning-color: #ff9800;
            --danger-color: #f44336;
            --info-color: #17a2b8;
            --light-color: #f8f9fa;
            --dark-color: #343a40;
            --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --gradient-success: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
            --gradient-info: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
            --gradient-warning: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
            --gradient-danger: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
            --shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.07);
            --shadow-hover: 0 18px 45px rgba(0, 0, 0, 0.1);
            --border-radius: 20px;
            --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.8;
            background: var(--gradient-primary);
            min-height: 100vh;
            padding: 20px;
            font-size: 16px;
            color: #333;
        }

        .math-container {
            max-width: 1200px;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(15px);
            border-radius: var(--border-radius);
            padding: 40px;
            box-shadow: var(--shadow-soft);
            border: 1px solid rgba(255, 255, 255, 0.3);
            position: relative;
            overflow: hidden;
            animation: slideInUp 0.8s ease-out;
        }

        .math-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: var(--gradient-primary);
            background-size: 200% 100%;
            animation: gradientShift 4s ease infinite;
            border-radius: var(--border-radius) var(--border-radius) 0 0;
        }

        @keyframes gradientShift {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }

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

        .math-header {
            text-align: center;
            margin-bottom: 40px;
            padding: 25px;
            background: rgba(102, 126, 234, 0.08);
            border-radius: var(--border-radius);
            position: relative;
        }

        .math-header h1 {
            color: var(--primary-color);
            font-size: 2.5em;
            font-weight: 700;
            margin-bottom: 10px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .math-header .sub-header {
            font-size: 1.1em;
            color: #666;
            display: flex;
            justify-content: center;
            gap: 40px;
            flex-wrap: wrap;
        }

        .exercises-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 30px;
            margin-bottom: 30px;
        }

        .exercise-card {
            background: #ffffff;
            border-radius: var(--border-radius);
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: var(--shadow-soft);
            border: 1px solid #e0e0e0;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }

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

        .exercise-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 4px;
            height: 100%;
            background: var(--gradient-primary);
            transition: width 0.3s ease;
        }

        .exercise-card:hover::before {
            width: 8px;
        }

        .exercise-header {
            display: flex;
            align-items: center;
            gap: 20px;
            margin-bottom: 25px;
            padding-bottom: 20px;
            border-bottom: 2px solid #f0f0f0;
        }

        .exercise-title {
            color: var(--primary-color);
            font-size: 1.5em;
            font-weight: 700;
            flex-grow: 1;
        }

        .exercise-number {
            background: var(--gradient-primary);
            color: white;
            padding: 8px 16px;
            border-radius: 50px;
            font-weight: 600;
            font-size: 0.9em;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .question-section {
            background: rgba(23, 162, 184, 0.08);
            padding: 20px;
            margin-bottom: 25px;
            border-radius: 15px;
            border-left: 4px solid var(--info-color);
        }

        .question-section h3 {
            color: var(--info-color);
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .exercise-content {
            color: #34495e;
            line-height: 2.2;
            margin-bottom: 25px;
        }

        .exercise-content p {
            margin-bottom: 15px;
        }

        .progress-stats {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            padding: 15px;
            border-radius: 10px;
            margin: 20px 0;
            text-align: center;
            border: 1px solid #dee2e6;
        }

        .progress-indicator {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-bottom: 10px;
        }

        .progress-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #dee2e6;
            transition: all 0.3s ease;
        }

        .progress-dot.active {
            background: var(--success-color);
            transform: scale(1.2);
        }

        .progress-dot.current {
            background: var(--warning-color);
            transform: scale(1.3);
            box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
        }

        .progress-buttons {
            display: flex;
            gap: 15px;
            margin: 25px 0;
            flex-wrap: wrap;
            align-items: center;
        }

        .progress-btn {
            font-family: 'Cairo', sans-serif;
            border: none;
            padding: 12px 24px;
            border-radius: 50px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            text-transform: none;
            min-width: 140px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .progress-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none !important;
        }

        .progress-btn:not(:disabled):hover {
            transform: translateY(-3px);
        }

        .btn-hint {
            background: var(--gradient-success);
            color: white;
            box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
        }

        .btn-hint:hover:not(:disabled) {
            box-shadow: 0 10px 25px rgba(76, 175, 80, 0.4);
        }

        .btn-method {
            background: var(--gradient-warning);
            color: white;
            box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
        }

        .btn-method:hover:not(:disabled) {
            box-shadow: 0 10px 25px rgba(255, 152, 0, 0.4);
        }

        .btn-solution {
            background: var(--gradient-info);
            color: white;
            box-shadow: 0 6px 20px rgba(23, 162, 184, 0.3);
        }

        .btn-solution:hover:not(:disabled) {
            box-shadow: 0 10px 25px rgba(23, 162, 184, 0.4);
        }

        .btn-reset {
            background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
            color: white;
            box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
            margin-right: auto;
        }

        .btn-reset:hover:not(:disabled) {
            box-shadow: 0 10px 25px rgba(108, 117, 125, 0.4);
        }

        .correction-section {
            display: none;
            margin: 20px 0;
            padding: 25px;
            border-radius: 15px;
            position: relative;
            overflow: hidden;
            animation: fadeInSlide 0.6s ease-out;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .correction-section.visible {
            display: block;
        }

        @keyframes fadeInSlide {
            from { 
                opacity: 0; 
                transform: translateY(-20px);
            }
            to { 
                opacity: 1; 
                transform: translateY(0);
            }
        }

        .correction-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 6px;
            height: 100%;
            border-radius: 3px;
        }

        .correction-hint {
            background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
            border: 1px solid #c3e6cb;
            color: #155724;
        }

        .correction-hint::before {
            background: #28a745;
        }

        .correction-hint h4 {
            color: #28a745;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .correction-method {
            background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
            border: 1px solid #faebcc;
            color: #856404;
        }

        .correction-method::before {
            background: #ffc107;
        }

        .correction-method h4 {
            color: #d39e00;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .correction-solution {
            background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
            border: 1px solid #b8daff;
            color: #0c5460;
        }

        .correction-solution::before {
            background: #17a2b8;
        }

        .correction-solution h4 {
            color: #138496;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .bounce-in {
            animation: bounceIn 0.8s ease-out;
        }

        @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;
            }
        }

        .pulse {
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(63, 81, 181, 0.4);
            }
            70% {
                box-shadow: 0 0 0 10px rgba(63, 81, 181, 0);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(63, 81, 181, 0);
            }
        }

        .sub-question {
            background: rgba(255, 255, 255, 0.7);
            padding: 15px;
            margin: 10px 0;
            border-radius: 10px;
            border-right: 3px solid var(--info-color);
        }

        @media (max-width: 768px) {
            .math-container {
                padding: 20px;
                margin: 10px;
            }
            
            .math-header h1 {
                font-size: 2em;
            }
            
            .progress-buttons {
                flex-direction: column;
            }
            
            .progress-btn {
                width: 100%;
                justify-content: center;
            }
            
            .exercise-header {
                flex-direction: column;
                text-align: center;
                gap: 10px;
            }
        }
    .exercise-content{font-size:1.06em;}.question-section{line-height:2.4;}.correction-solution p{margin-bottom:16px;padding-bottom:12px;line-height:2.5;border-bottom:1px dashed rgba(108,92,231,0.22);}.correction-solution p:last-child{border-bottom:none;}.correction-hint li,.correction-method p,.correction-method li{line-height:2.3;margin-bottom:10px;}.draw-note{background:rgba(250,112,154,0.10);border-right:4px solid #fa709a;padding:10px 16px;border-radius:10px;margin:14px 0;font-weight:600;}
