/* ============================================
   ARCHIRENDER MASTER - CSS V9.0
   ============================================ */

/* 1. CONFIGURATION DES ONGLETS (TABS) */
.active-tab {
    border-bottom: 2px solid #3b82f6;
    color: white !important;
    background: rgba(59, 130, 246, 0.05);
}

/* 2. WIDGET SOLAIRE (INTERACTIF) */
#sun-position-widget {
    position: relative;
    border: 2px solid #1e293b;
    background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
    cursor: crosshair;
    transition: border-color 0.3s ease;
}

#sun-position-widget:hover {
    border-color: #334155;
}

#sun-cursor {
    pointer-events: none;
    /* Le clic est géré par le parent */
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, #fef08a 0%, #facc15 60%, #eab308 100%);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
    border: 2px solid white;
}

/* 3. BARRE DE PROMPT & SAISIE (TOP BAR) */
#custom-prompt {
    transition: all 0.3s ease;
    background: #020617;
}

#custom-prompt:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: #0f172a;
}

/* 4. CORRECTIFS DE NETTETÉ 4K & ALIGNEMENT */
#canvas-container {
    display: flex;
    align-items: center;
    justify-content: center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

canvas {
    image-rendering: pixelated;
    /* Pour garder la précision du tracé */
    touch-action: none;
    /* Empêche le scroll pendant le dessin */
}

/* 5. ÉTATS DES BOUTONS DE QUALITÉ */
.quality-btn {
    border: 1px solid #1e293b;
    color: #64748b;
    transition: all 0.2s ease;
}

.quality-btn:hover {
    border-color: #334155;
    color: #cbd5e1;
}

.quality-btn.active {
    background-color: #2563eb !important;
    border-color: #60a5fa !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.3);
}

/* 6. PRESET CARDS (Grilles de boutons) */
.preset-card {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid rgba(30, 41, 59, 0.5);
}

.preset-card:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-1px);
}

/* 7. TOOLBARS FLOTTANTES */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 8. ANIMATIONS */
@keyframes pulse-soft {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.animate-pulse-soft {
    animation: pulse-soft 2s infinite ease-in-out;
}

/* 9. FAILSAFE LAYOUT (Si Tailwind échoue) */
aside {
    position: relative !important;
    /* Force le contexte de positionnement pour les panels absolus */
    width: 20rem;
    /* w-80 fallback */
    background-color: #020617;
    /* bg-slate-950 fallback */
}

/* 10. ACTIVE PRESET CHIPS */
.preset-chip {
    padding: 2px 8px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.preset-chip:hover {
    background: #334155;
    color: white;
    border-color: #3b82f6;
}

.preset-chip .remove-btn {
    color: #64748b;
    cursor: pointer;
    font-size: 10px;
}

.preset-chip .remove-btn:hover {
    color: #ef4444;
}

/* 11. MULTI-SELECT DROPDOWN STYLES */
.cat-header {
    background: rgba(30, 41, 59, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 10px;
}

.preset-item-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.preset-item-checkbox:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* 12. ANNOTATIONS SYSTEM */
.annotation-label .shadow-glow,
.annotation-anchor.shadow-glow {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
}

.annotation-anchor {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.annotation-anchor:hover {
    transform: translate(-50%, -50%) scale(1.4) !important;
    box-shadow: 0 0 15px currentColor;
}

.ann-color-btn {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.ann-color-btn:hover {
    transform: scale(1.2);
}

.ann-color-btn.active {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    transform: scale(1.1);
}

.move-handle {
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.move-handle:hover {
    opacity: 1;
}


/* Thème Technique (Ingénierie) */
.theme-technical div[contenteditable] {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    font-size: 10px;
    background: rgba(15, 23, 42, 0.9);
    border-color: #334155;
    color: #3b82f6;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
}

/* Thème Sketch (Main Levée) */
@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&display=swap');

#annotation-palette {
    width: 140px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

#annotation-palette button:hover {
    transform: translateY(-1px);
}

#sidebar-context-panels>div {
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.2);
}

.sidebar-scroll {
    mask-image: linear-gradient(to bottom, transparent, black 20px, black calc(100% - 20px), transparent);
}

.theme-sketch .annotation-text {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    /* Caveat needs to be a bit larger to be readable */
    font-weight: 700;
    background: transparent;
    border-color: transparent;
    color: inherit;
    /* Use the color set on the label */
    padding-bottom: 0px;
    transform: rotate(-1deg);
}

.theme-sketch .rounded-full {
    background: #1e293b !important;
    width: 6px !important;
    height: 6px !important;
}

.theme-sketch .px-3 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}