/**
 * ════════════════════════════════════════════════════════════════
 *  BLUE BIRD CRM - DESKTOP PORTAL DESIGN (HR, MANAGER, CEO)
 *  Unified Design System - Premium Glassmorphism & Clean UI
 * ════════════════════════════════════════════════════════════════
 */

@import 'variables.css';
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ══════════ RESET & BASE ══════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    /* Premium Subtle Gradient Background */
    background-image: 
        radial-gradient(at 0% 0%, rgba(13, 110, 253, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(13, 202, 240, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

/* ══════════ LAYOUT STRUCTURE ══════════ */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow: hidden; /* Prevent body scroll if sidebar is independent */
}

/* Sidebar */
.sidebar {
    width: 280px; /* Fixed width */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px; /* Matches Sidebar width */
    padding: var(--space-xl);
    min-height: 100vh;
    width: calc(100% - 280px);
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Topbar in Main Content */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
}

/* ══════════ TYPOGRAPHY ══════════ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* ══════════ CARD COMPONENT (Glass & Solid) ══════════ */
.card, .glass-panel {
    background: rgba(255, 255, 255, 0.85); /* Slightly translucent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-card);
    border-radius: var(--radius-xl); /* Rounded Modern Look */
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

/* Hover effect for interactive cards */
.card.interactive:hover, .glass-panel.interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ══════════ BUTTONS ══════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
    filter: brightness(1.05);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* ══════════ FORM ELEMENTS ══════════ */
.form-input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    background: rgba(255,255,255,0.8);
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.form-input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* ══════════ TABLE STYLES ══════════ */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

tr:hover td {
    background: rgba(0,0,0,0.01);
}

/* ══════════ BADGES & UTILITIES ══════════ */
.badge {
    display: inline-flex;
    padding: 0.25em 0.7em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-full);
}

.bg-primary { background: rgba(13, 110, 253, 0.1); color: var(--primary); }
.bg-success { background: var(--success-light); color: var(--success); }
.bg-warning { background: var(--warning-light); color: #856404; }
.bg-danger { background: var(--danger-light); color: var(--danger); }

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%); /* Hidden by default on tablet/mobile */
        box-shadow: var(--shadow-lg);
    }
    
    .main-content {
        margin-left: 0; 
        width: 100%;
        padding: var(--space-md);
    }
    
    /* When sidebar is active */
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
}

/* Toggle for Desktop Collapsed Mode (Optional) */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}
body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
}
