/* Styles personnalisés pour l'interface AI Controls */

/* Layout principal en 3 colonnes */
.canvas-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    min-height: 70vh;
    margin: 2rem 0;
}

/* Panneaux latéraux */
.left-panel, .right-panel {
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Panneau central */
.center-panel {
    background: var(--pico-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Sections dans les panneaux */
.panel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.panel-section h3 {
    margin-bottom: 0.5rem;
    color: var(--pico-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Zone de texte */
textarea {
    flex: 1;
    min-height: 120px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Bouton magique */
.magic-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem auto;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Bouton clipboard */
.clipboard-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    margin-top: 0.5rem;
}

.clipboard-button:hover {
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.magic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.magic-button:active {
    transform: translateY(0);
}

.magic-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.magic-icon {
    font-size: 1.2rem;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

/* Zone de proposition */
.proposal-container {
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    min-height: 200px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-y: auto;
}

.proposal-container .placeholder {
    color: var(--pico-muted-color);
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

/* Configuration API */
.api-config {
    margin-top: 2rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
}

.api-config summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--pico-primary);
}

/* Animation de chargement */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--pico-muted-border-color);
    border-radius: 50%;
    border-top-color: var(--pico-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 1024px) {
    .canvas-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .left-panel, .right-panel, .center-panel {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .canvas-layout {
        margin: 1rem 0;
    }
    
    .magic-button {
        min-width: 150px;
        padding: 0.8rem 1.5rem;
    }
}

/* Amélioration du thème dark */
[data-theme="dark"] {
    --pico-background-color: #1a1a1a;
    --pico-card-background-color: #2a2a2a;
    --pico-muted-border-color: #404040;
    --pico-muted-color: #888;
}

/* Style pour les messages d'erreur */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    padding: 0.75rem;
    border-radius: var(--pico-border-radius);
    margin: 0.5rem 0;
}

/* Style pour les messages de succès */
.success-message {
    background: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.3);
    color: #198754;
    padding: 0.75rem;
    border-radius: var(--pico-border-radius);
    margin: 0.5rem 0;
}

/* Actions de la proposition */
.proposal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.action-button {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.action-button:active {
    transform: translateY(0);
}

.action-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.copy-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.copy-button:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.shorter-button {
    background: linear-gradient(135deg, #fd7e14 0%, #e83e8c 100%);
    box-shadow: 0 2px 8px rgba(253, 126, 20, 0.3);
}

.shorter-button:hover {
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.4);
}

.action-icon {
    font-size: 1rem;
}