/* ============================================
   Shad - Global Styles
   Superhuman/Linear inspired aesthetic
   ============================================ */

:root {
    --bg-sidebar: #1a1a2e;
    --bg-main: #f8f9fa;
    --bg-white: #fff;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --accent: #4361ee;
    --accent-hover: #3a56d4;
    --border: #e9ecef;
    --hover-bg: #f1f3f5;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- App Layout ---- */

.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ---- Sidebar ---- */

.sidebar {
    background: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 24px 24px 20px;
    letter-spacing: 1px;
    color: #fff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-item {
    padding: 10px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(67, 97, 238, 0.3);
    color: #fff;
}

.nav-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding: 24px;
}

.server-restart {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin-bottom: 12px;
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 0.8125rem;
    font-family: inherit;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* ---- Login Overlay ---- */

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
}

.login-title {
    font-size: 2rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin: 8px 0 32px;
    font-size: 0.9375rem;
}

.login-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.login-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

/* ---- Main Content ---- */

.main-content {
    overflow: hidden;
    background: var(--bg-main);
}

.page-view {
    height: 100%;
    overflow: hidden;
}

/* ---- Toast Notifications ---- */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast-info {
    background: var(--accent);
}

.toast-fade {
    opacity: 0;
    transition: opacity 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ---- Scrollbar ---- */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}
