/* 🌌 Style Principal de l'Application ALF */
:root {
    --primary: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #06d6a0;
    --accent: #f59e0b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #475569;
    --shadow: rgba(0, 0, 0, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(6, 214, 160, 0.1) 0%, transparent 50%);
}

/* Header de l'application */
.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0;
    box-shadow: 0 2px 10px var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.app-header h1 {
    font-size: 1.4em;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    padding: 8px 16px;
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Barre de statut */
.status-bar {
    background: var(--background);
    padding: 6px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: var(--text-muted);
}

#status.connected {
    color: var(--success);
}

/* Zone de travail */
.workspace {
    height: calc(100vh - 90px);
    position: relative;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    right: -250px;
    top: 90px;
    width: 250px;
    height: calc(100vh - 90px);
    background: var(--surface);
    border-left: 1px solid var(--border);
    transition: right 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.sidebar:hover {
    right: 0;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h3 {
    font-size: 0.9em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.sidebar-btn {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-btn:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateX(-5px);
}

/* Fenêtres */
.window {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 25px var(--shadow);
    min-width: 300px;
    min-height: 200px;
    resize: both;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.window-header {
    background: var(--surface-light);
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: move;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.window-controls {
    display: flex;
    gap: 5px;
}

.window-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.window-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.window-content {
    height: calc(100% - 50px);
    padding: 0;
}

.animation-canvas {
    width: 100%;
    height: 100%;
    border-radius: 0 0 8px 8px;
}

/* États */
.window.active {
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--shadow);
}

.window.minimized {
    height: 50px !important;
}

.window.minimized .window-content {
    display: none;
}

/* Animation d'entrée */
@keyframes windowAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.window.new {
    animation: windowAppear 0.3s ease-out;
}

/* Mode plein écran */
body.fullscreen .app-header,
body.fullscreen .sidebar {
    display: none;
}

body.fullscreen .workspace {
    height: 100vh;
}