/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Arabic', Arial, sans-serif;
    background: linear-gradient(135deg, #1e40af 0%, #059669 100%);
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title i {
    color: #667eea;
    font-size: 2.2rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}
/* Style de la bannière */
#ind #banier {
    width: 100%; /* Largeur totale */
    height: auto; /* Hauteur automatique selon le contenu */
    margin-bottom: -8px;
}
/* Main Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px;
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px; /* optionnel pour un arrondi agréable */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

}


/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
   
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Animation for result cards */
.result-card {
    animation: fadeInUp 0.5s ease-out;
}

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

/* Footer */
        footer .container {
            background: #333;
            color: white;
            text-align: center;
            padding: 2rem 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin-top: 10px;
        }
        footer .container p{
            margin: 0;
            padding: 0 10px;
        }

        footer{
             background: #333;
        }


        .devoir-images {
            margin-bottom: 30px;
        }
.devoir-images h2 {
    color: #4facfe;
    font-size: 1.4em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center; /* centré */
}

.devoir-images h2::before {
    content: "📄";
    margin-left: 10px; /* espace entre l'icône et le texte */
    font-size: 1.2em;
}
        .images-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .image-container {
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
        }

        .image-container:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0,0,0,0.15);
        }

        .image-container img {
            width: 100%;
            height: auto;
            display: block;
        }

        .loading {
            text-align: center;
            padding: 60px 20px;
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #4facfe;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 30px;
        }

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

        .loading-text {
            font-size: 1.3em;
            color: #666;
            margin-bottom: 15px;
        }

        .loading-dots {
            font-size: 1.5em;
            color: #4facfe;
        }

        .loading-dots::after {
            content: '';
            animation: dots 1.5s infinite;
        }

        @keyframes dots {
            0%, 20% { content: ''; }
            40% { content: '.'; }
            60% { content: '..'; }
            80%, 100% { content: '...'; }
        }

        #resultat {
            display: none;
            background: #f8f9fa;
            border-radius: 10px;
            padding: 30px;
            margin-top: 20px;
            border-right: 5px solid #4facfe;
            line-height: 1.8;
            font-size: 1.1em;
            color: #333;
            white-space: pre-wrap;
            word-wrap: break-word;
            text-align: right;
            position: relative;
        }

        .correction-title {
            color: #4facfe;
            font-size: 1.4em;
            font-weight: 600;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .correction-title::after {
            content: "🤖";
            margin-left: 10px;
            font-size: 1.2em;
        }

        .correction-controls {
            position: absolute;
            top: 15px;
            left: 15px;
            display: flex;
            gap: 10px;
        }

        .control-btn {
            background: #4facfe;
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 0.9em;
            cursor: pointer;
            transition: all 0.3s ease;
            opacity: 0.8;
        }

        .control-btn:hover {
            background: #3d8bfe;
            opacity: 1;
            transform: translateY(-1px);
        }

        .control-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
            transform: none;
        }

        .error {
            background: #ffe6e6;
            border-right-color: #ff4757;
            color: #c44569;
        }

        .typing-cursor {
            display: inline-block;
            background-color: #4facfe;
            width: 2px;
            height: 1.2em;
            animation: blink 1s infinite;
            margin-right: 2px;
        }

        @keyframes blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0; }
        }

        .retry-btn {
            background: #4facfe;
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 25px;
            font-size: 1em;
            cursor: pointer;
            margin-top: 20px;
            transition: all 0.3s ease;
        }

        .retry-btn:hover {
            background: #3d8bfe;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(61, 139, 254, 0.3);
        }

        .status-badge {
            display: inline-block;
            background: #28a745;
            color: white;
            padding: 5px 12px;
            border-radius: 15px;
            font-size: 0.8em;
            margin-bottom: 15px;
        }

        .status-badge.cached {
            background: #17a2b8;
        }

        @media (max-width: 768px) {
          
            
         
            
           

            .images-grid {
                grid-template-columns: 1fr;
            }

            .correction-controls {
                position: static;
                margin-bottom: 15px;
                justify-content: center;
            }
        }

        /* Style du bloc avis */
        .avis-container {
            margin-top: 2rem;
            padding: 1rem;
            background: #f9f9f9;
            border-radius: 10px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.05);
        }
        .avis-title {
            font-size: 1.2rem;
            margin-bottom: 1rem;
            font-weight: bold;
        }
        .stars {
            display: flex;
            flex-direction: row-reverse;
            justify-content: flex-start;
            gap: 5px;
            font-size: 1.8rem;
            cursor: pointer;
        }
        .stars i {
            color: #ccc;
            transition: color 0.2s;
        }
        .stars i.active {
            color: gold;
        }
        .avis-comment {
            margin-top: 1rem;
            width: 100%;
            min-height: 80px;
            padding: 0.5rem;
            border: 1px solid #ddd;
            border-radius: 8px;
            resize: vertical;
            font-family: inherit;
        }
        .avis-btn {
            margin-top: 1rem;
            background: #28a745;
            color: white;
            padding: 0.6rem 1.2rem;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
        }
        .avis-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        @media(max-width: 600px) {
            .stars { font-size: 1.5rem; }
        }