/* Styles spécifiques à la page AI Generate - Préfixés avec .ai-generate-page */
.ai-generate-page .ai-generation-layout label.required {
    display: none !important;
}

.ai-generate-page .themes-table label.required,
.ai-generate-page .events-table-container label.required {
    display: none !important;
}

/* Ajustement des colonnes du tableau */
.ai-generate-page .events-table-container .events-table th:nth-child(4), /* Colonne Thèmes */
.ai-generate-page .events-table-container .events-table td:nth-child(4) {
    width: 35%;
    min-width: 300px;
}

.ai-generate-page .events-table-container .events-table th:nth-child(6), /* Colonne Actions */
.ai-generate-page .events-table-container .events-table td:nth-child(6) {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

.ai-generate-page .themes-table .events-table th:nth-child(5), /* Colonne Actions des thèmes */
.ai-generate-page .themes-table .events-table td:nth-child(5) {
    width: 60px;
    min-width: 60px;
    text-align: center;
}

/* Ajustement de la hauteur des textarea de description */
.ai-generate-page .events-table-container .events-table td {
    vertical-align: top;
    padding: 8px;
}

.ai-generate-page .events-table-container .events-table textarea {
    height: 100% !important;
    min-height: 120px;
    resize: vertical;
}

/* Loader IA ultra stylé */
.ai-generate-page .ai-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.ai-generate-page .ai-loader.show {
    display: flex !important;
    opacity: 1;
}

.ai-generate-page .ai-loader-container {
    text-align: center;
    color: white;
}

.ai-generate-page .robot-head {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    background: linear-gradient(45deg, #4fc3f7 0%, #29b6f6 100%);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.4);
    animation: robotBob 2s ease-in-out infinite;
    border: 3px solid #81d4fa;
}

.ai-generate-page .robot-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 50px;
}

.ai-generate-page .robot-eye {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: robotBlink 3s ease-in-out infinite;
    border: 2px solid #333;
}

.ai-generate-page .robot-eye.left {
    top: 10px;
    left: 10px;
}

.ai-generate-page .robot-eye.right {
    top: 10px;
    right: 10px;
}

.ai-generate-page .robot-pupil {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: #333;
    border-radius: 50%;
    animation: robotLook 4s ease-in-out infinite;
}

.ai-generate-page .robot-mouth {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 8px;
    background: #333;
    border-radius: 0 0 8px 8px;
    border: 2px solid #333;
    border-top: none;
}

.ai-generate-page .robot-cheek {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffb3ba;
    border-radius: 50%;
    bottom: 18px;
    opacity: 0.7;
}

.ai-generate-page .robot-cheek.left {
    left: 2px;
}

.ai-generate-page .robot-cheek.right {
    right: 2px;
}

.ai-generate-page .connection.c1 {
    top: 24px;
    left: 38px;
    width: 44px;
    transform: rotate(0deg);
}

.ai-generate-page .connection.c2 {
    top: 60px;
    left: 18px;
    width: 84px;
    transform: rotate(45deg);
}

.ai-generate-page .connection.c3 {
    bottom: 24px;
    left: 38px;
    width: 44px;
    transform: rotate(0deg);
}

.ai-generate-page .connection.c4 {
    top: 60px;
    right: 18px;
    width: 84px;
    transform: rotate(-45deg);
}

.ai-generate-page .ai-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 20px;
}

.ai-generate-page .typing-text {
    display: inline-block;
    background: linear-gradient(45deg, #667eea, #764ba2, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.2s ease-in-out;
    animation: textGlow 2s ease-in-out infinite;
}

.ai-generate-page .dots {
    display: inline-block;
    margin-left: 5px;
}

.ai-generate-page .dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    margin: 0 2px;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.ai-generate-page .dots span:nth-child(1) {
    animation-delay: 0s;
}

.ai-generate-page .dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-generate-page .dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animations */
@keyframes robotBob {
    0%, 100% { 
        transform: translateY(0);
    }
    50% { 
        transform: translateY(-5px);
    }
}

@keyframes robotBlink {
    0%, 90%, 100% { 
        opacity: 1;
    }
    95% { 
        opacity: 0.2;
    }
}

@keyframes robotLook {
    0%, 100% { 
        transform: translateX(0);
    }
    25% { 
        transform: translateX(2px);
    }
    75% { 
        transform: translateX(-2px);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(102, 126, 234, 0.8);
    }
    50% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 1);
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Layout de génération IA */
.ai-generation-layout {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 30px;
    min-height: 500px;
}

.ai-input-section {
    border-right: 1px solid #dee2e6;
    padding-right: 30px;
}

.ai-results-section {
    padding-left: 30px;
    margin: 20px 0;
}

.no-results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    min-height: 300px;
}

.no-results-placeholder i {
    color: #007aff;
    margin-bottom: 20px;
}

.no-results-placeholder h5 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.no-results-placeholder p {
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 300px;
}

/* Tableaux de résultats */
.ai-generate-page .results-tables {
    display: grid;
    gap: 30px;
}

.ai-generate-page .themes-table, .ai-generate-page .events-table-container {
    margin-bottom: 20px;
}

.ai-generate-page .themes-table h5, .ai-generate-page .events-table-container h5 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.ai-generate-page .themes-table, .ai-generate-page .events-table-container {
    margin-bottom: 15px;
}

.ai-generate-page .themes-table h5, .ai-generate-page .events-table-container h5 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1rem;
}

.ai-generate-page .themes-table table, .ai-generate-page .events-table-container table {
    font-size: 0.85rem;
}

.ai-generate-page .themes-table th, .ai-generate-page .events-table-container th {
    font-size: 0.8rem;
    padding: 8px;
}

.ai-generate-page .themes-table td, .ai-generate-page .events-table-container td {
    padding: 8px;
}

.ai-generate-page .events-table-container th:nth-child(2), .ai-generate-page .events-table-container td:nth-child(2) {
    width: 25%;
    min-width: 150px;
}

.ai-generate-page .events-table-container th:nth-child(1), .ai-generate-page .events-table-container td:nth-child(1) {
    width: 25%;
}

.ai-generate-page .events-table-container th:nth-child(3), .ai-generate-page .events-table-container td:nth-child(3) {
    width: 12%;
}

.ai-generate-page .events-table-container th:nth-child(4), .ai-generate-page .events-table-container td:nth-child(4) {
    width: 15%;
}

.ai-generate-page .events-table-container th:nth-child(5), .ai-generate-page .events-table-container td:nth-child(5) {
    width: 8%;
}

/* Boutons et formulaires */
.ai-generate-page .btn-medium {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ai-generate-page .btn-medium-primary {
    background-color: #007aff;
    color: white;
}

.ai-generate-page .btn-medium-primary:hover {
    background-color: #0056b3;
}

.ai-generate-page .btn-medium-secondary {
    background-color: #6c757d;
    color: white;
}

.ai-generate-page .btn-medium-secondary:hover {
    background-color: #545b62;
}

.ai-generate-page .action-btn {
    padding: 5px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.ai-generate-page .action-btn.delete {
    background-color: #dc3545;
    color: white;
}

.ai-generate-page .action-btn.delete:hover {
    background-color: #c82333;
}

.ai-generate-page .btn-loading {
    align-items: center;
    gap: 8px;
}

.ai-generate-page .btn-loading i {
    animation: spin 1s linear infinite;
}

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

/* Champs de formulaire */
.ai-generate-page .form-control {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.9rem;
}

.ai-generate-page .form-control:focus {
    border-color: #007aff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.ai-generate-page .event-options, .ai-generate-page .theme-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ai-generate-page .parent-selection {
    margin-bottom: 5px;
}

.ai-generate-page .theme-parent-select {
    font-size: 0.8rem;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    max-width: 150px;
}

.ai-generate-page .checkbox-group {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
}

.ai-generate-page .checkbox-group input[type="checkbox"] {
    margin: 0;
}

.ai-generate-page .checkbox-group label {
    margin: 0;
    font-weight: normal;
}

.ai-generate-page input[type="color"] {
    width: 50px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
}

/* Styles pour la sélection des thèmes compacte */
.ai-generate-page .themes-selection-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
    padding: 2px;
}

.ai-generate-page .theme-option-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.ai-generate-page .theme-option-compact:hover {
    background-color: #f8f9fa;
}

.ai-generate-page .theme-checkbox-compact {
    margin: 0;
    cursor: pointer;
}

.ai-generate-page .theme-label-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: normal;
    font-size: 0.8rem;
    cursor: pointer;
    flex: 1;
}

.ai-generate-page .theme-color-compact {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.ai-generate-page .theme-name-compact {
    font-size: 0.75rem;
    line-height: 1.2;
}

.ai-generate-page .theme-option-compact input[type="checkbox"]:checked + .ai-generate-page .theme-label-compact {
    background-color: #e3f2fd;
    border-radius: 3px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.ai-generate-page .theme-option-compact input[type="checkbox"]:checked + .ai-generate-page .theme-label-compact .ai-generate-page .theme-name-compact {
    font-weight: 500;
    color: #1976d2;
}

/* Amélioration du scrollbar pour la sélection compacte */
.ai-generate-page .themes-selection-compact::-webkit-scrollbar {
    width: 4px;
}

.ai-generate-page .themes-selection-compact::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.ai-generate-page .themes-selection-compact::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.ai-generate-page .themes-selection-compact::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-generate-page .ai-generation-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ai-generate-page .ai-input-section {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding-right: 0;
        padding-bottom: 20px;
    }
    
    .ai-generate-page .ai-results-section {
        padding-left: 0;
        padding-top: 20px;
    }
    
    .ai-generate-page .themes-selection-compact {
        max-height: 120px;
    }
    
    .ai-generate-page .theme-name-compact {
        font-size: 0.7rem;
    }
}