:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --text-dark: #0f172a;
}

body {
    height: 100vh;
    margin: 0;
    padding: 1.5rem;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
    background: linear-gradient(-45deg, #e0e7ff, #f3e8ff, #fae8ff, #f8fafc);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #1e293b;
    display: flex;
    flex-direction: column;
}

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

/* Glassmorphism Structural Panels */
.main-container {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.25rem;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

.sidebar-panel {
    background: rgba(241, 245, 249, 0.65);
    display: flex;
    flex-direction: column;
}

.workspace-panel {
    background: rgba(255, 255, 255, 0.75);
}

/* Responsive Sidebar Constraints */
@media (max-width: 767.98px) {
    .sidebar-panel {
        max-height: 35vh; 
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    }
}

@media (min-width: 768px) {
    .sidebar-panel {
        width: 30%;
        max-width: 320px; 
        min-width: 250px;
        border-right: 1px solid rgba(226, 232, 240, 0.8);
    }
}

/* Auth & Login Specific Panels */
.login-panel {
    background: rgba(244, 231, 250, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
    border-radius: 1rem;
}

/* Input & Textarea Elements */
.glass-input {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25) !important;
}

.editor-textarea {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-dark) !important;
    font-weight: 450;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.9rem;
    resize: none;
}

.editor-textarea:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}
.glass-select {
    background-color: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(8px);
    color: #475569 !important;
    font-weight: 500;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

.glass-select:hover {
    background-color: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #1e293b !important;
}

.glass-select:focus {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: #6366f1 !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* Force un fond blanc propre pour la liste déroulante OS */
.glass-select option, .glass-select optgroup {
    background-color: #ffffff;
    color: #1e293b;
}

/* UI Assets & Layout Components */
.logo-login {
    max-width: 200px;
    height: auto;
}

.logo-admin {
    height: 32px;
    width: auto;
}

.text-dark-contrast { 
    color: var(--text-dark) !important; 
}

/* Prompt File List Navigation Items */
.file-list-item {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.file-list-item:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.file-list-item.active {
    background: rgba(255, 255, 255, 0.95);
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Comportement du petit bouton d'édition rapide au survol */
.edit-quick-btn {
    opacity: 0.3;
    transition: opacity 0.2s;
}
.file-list-item:hover .edit-quick-btn {
    opacity: 0.8;
}
.file-list-item .edit-quick-btn:hover {
    opacity: 1 !important;
    color: #4f46e5 !important;
}

/* Micro-Animations & Custom Transitions */
.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Custom Webkit Scrollbars */
::-webkit-scrollbar { 
    width: 6px; 
}
::-webkit-scrollbar-track { 
    background: transparent; 
}
::-webkit-scrollbar-thumb { 
    background: rgba(0, 0, 0, 0.15); 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: rgba(0, 0, 0, 0.3); 
}

/* Custom scrollbar for the chat modal */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 4px;
}

/* --- Modale Chat & Bulles --- */
.chat-bubble {
    font-size: 0.95rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
    position: relative;
    white-space: pre-wrap;
}

.chat-bubble-user {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    color: #ffffff;
    border-bottom-right-radius: 4px !important;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
}

.chat-bubble-ai {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom-left-radius: 4px !important;
    box-shadow: 0 4px 15px rgba(31, 38, 135, 0.05);
    backdrop-filter: blur(10px);
}

.chat-choice-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-dark);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-choice-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.12);
}

.chat-choice-btn:disabled {
    opacity: 0.5;
    transform: none;
    cursor: default;
}

#col-config .form-control:focus {
    color: var(--text-dark) !important;
    background-color: rgba(255, 255, 255, 0.4) !important;
    border-radius: 4px;
    padding-left: 8px !important;
    transition: all 0.2s ease;
}

#crafterModeTabs .nav-link { opacity: 0.6; transition: all 0.2s; }
#crafterModeTabs .nav-link.active { opacity: 1; border-bottom: 2px solid #4f46e5 !important; }

.preview-card-studio {
    background: #ffffff;
    border-radius: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
    transition: all 0.15s ease;
}

.hue-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s;
}

.hue-swatch:hover {
    transform: scale(1.2);
}

.hue-range-spectrum {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, 
        hsl(0, 100%, 50%), hsl(60, 100%, 50%), hsl(120, 100%, 50%), 
        hsl(180, 100%, 50%), hsl(240, 100%, 50%), hsl(300, 100%, 50%), hsl(360, 100%, 50%)
    );
    outline: none;
}

.hue-range-spectrum::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0f172a;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}