/* app/static/css/base.css */

:root {
    --bg-gradient: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 50%, #020617 100%);
    --bg: #090d16;
    --surface: rgba(15, 23, 42, 0.55);
    --surface-solid: #0f172a;
    --surface-hover: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text: #f8fafc;
    --muted: #94a3b8;
    
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --warning-text: #fef08a;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --success-text: #a7f3d0;
    
    --danger: #f43f5e;
    --danger-glow: rgba(244, 63, 94, 0.2);
    --danger-text: #fecdd3;
    
    --radius: 20px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* App Shell Layout */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.4);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.brand-logo i {
    width: 22px;
    height: 22px;
    stroke: white;
}

.sidebar-brand span {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 500;
}

.sidebar-nav a i {
    width: 20px;
    height: 20px;
}

.sidebar-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav a.active {
    color: white;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.family-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-weight: 600;
    color: var(--muted);
}

.family-badge i {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
}

/* Main Area Layout */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
}

/* Topbar Styling */
.topbar {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 13, 22, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    z-index: 500;
}

.page-heading {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Page Content container */
.page-content {
    padding: 40px;
    flex: 1;
}

/* Flash Messages */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.flash {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.flash-body {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.flash-body i {
    width: 20px;
    height: 20px;
}

.flash-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success-text);
}

.flash-danger,
.flash-error {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--danger-text);
}

.flash-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning-text);
}

.flash-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text);
}

.flash-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

/* Animations */
@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 30px 10px;
        align-items: center;
    }
    
    .sidebar-brand span,
    .sidebar-nav span,
    .family-badge span {
        display: none;
    }
    
    .sidebar-brand {
        margin-bottom: 30px;
    }
    
    .sidebar-nav a {
        padding: 14px;
        justify-content: center;
    }
    
    .family-badge {
        justify-content: center;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .sidebar::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar-brand {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .sidebar-nav {
        flex-direction: row;
        gap: 16px;
        flex-shrink: 0;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .topbar {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .topbar-right {
        gap: 10px;
    }
    
    .page-heading {
        font-size: 1.25rem;
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .page-content {
        padding: 16px;
    }
}