/* ============================================= */
/*  AdminBlazorApp — Deploy Dashboard Styles     */
/* ============================================= */

:root {
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38bdf8;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --terminal-bg: #0f172a;
    --terminal-text: #e2e8f0;
    --accent: #3b82f6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    margin: 0;
    min-height: 100vh;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--sidebar-active);
}

.sidebar-brand h5 {
    margin: 0;
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-brand small {
    color: var(--sidebar-text);
    font-size: 0.7rem;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
    color: var(--sidebar-active);
    background: rgba(56, 189, 248, 0.08);
    border-left-color: var(--sidebar-active);
}

.sidebar-nav a i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.75rem;
    color: #475569;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    background: var(--card-bg);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-topbar h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.app-content {
    padding: 1.5rem 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Cards */
.action-card {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.action-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.action-card .card-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.action-card h6 {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.action-card .text-muted {
    font-size: 0.8rem;
    margin: 0.25rem 0 0;
}

/* Terminal output */
.terminal-output {
    background: var(--terminal-bg);
    color: var(--terminal-text);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-output .line-success {
    color: var(--success);
}

.terminal-output .line-error {
    color: var(--danger);
}

.terminal-output .line-warning {
    color: var(--warning);
}

.terminal-output .line-info {
    color: var(--sidebar-active);
}

/* Progress */
.deploy-progress {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.deploy-progress .bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-idle { background: #f1f5f9; color: #64748b; }
.status-running { background: #dbeafe; color: #2563eb; }
.status-success { background: #dcfce7; color: #16a34a; }
.status-failed { background: #fef2f2; color: #dc2626; }
.status-cancelled { background: #fef9c3; color: #a16207; }

/* Info panels */
.info-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.info-panel dt {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-panel dd {
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Settings form */
.server-card {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.server-card.active-role {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.server-card .role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-dev { background: #dbeafe; color: #1d4ed8; }
.role-prod { background: #dcfce7; color: #15803d; }

/* Swap animation */
.swap-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.25rem;
    color: var(--accent);
}

.swap-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: rotate(180deg);
}

/* Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-action-primary { background: var(--accent); color: white; }
.btn-action-primary:hover:not(:disabled) { background: #2563eb; color: white; }

.btn-action-success { background: var(--success); color: white; }
.btn-action-success:hover:not(:disabled) { background: #16a34a; color: white; }

.btn-action-warning { background: var(--warning); color: white; }
.btn-action-warning:hover:not(:disabled) { background: #d97706; color: white; }

.btn-action-danger { background: var(--danger); color: white; }
.btn-action-danger:hover:not(:disabled) { background: #dc2626; color: white; }

.btn-action-outline { background: white; color: #475569; border: 1px solid #cbd5e1; }
.btn-action-outline:hover:not(:disabled) { background: #f8fafc; color: #1e293b; }

/* Spinner */
.spinner-sm {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Blazor error */
.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem;
    color: white;
    border-radius: 0.5rem;
}

.blazor-error-boundary::after {
    content: "Une erreur s'est produite."
}

#blazor-error-ui {
    display: none;
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 999;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .app-sidebar { width: 60px; }
    .sidebar-brand h5, .sidebar-brand small, .sidebar-nav a span, .sidebar-footer { display: none; }
    .sidebar-nav a { justify-content: center; padding: 0.75rem; }
    .app-content { padding: 1rem; }
}
