/* ==========================================================================
   SMARTPRINT - Glassmorphism UI & Design System
   College Smart Printing Management System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Custom Variables & Colors
   -------------------------------------------------------------------------- */
:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Light Theme Palette */
    --bg-gradient: linear-gradient(135deg, #f0f4fd 0%, #e2e8f8 50%, #d8e2f8 100%);
    --bg-surface: rgba(255, 255, 255, 0.75);
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-glass: rgba(255, 255, 255, 0.6);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --accent-cyan: #06b6d4;
    --accent-purple: #a855f7;
    
    /* Status Colors */
    --status-blue: #3b82f6;      /* Pending */
    --status-orange: #f59e0b;    /* Printing */
    --status-green: #10b981;     /* Completed */
    --status-red: #ef4444;       /* Cancelled */
    
    --sidebar-width: 260px;
    --navbar-height: 70px;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark Theme Palette */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --bg-surface: rgba(30, 41, 59, 0.7);
    --bg-card: rgba(30, 41, 59, 0.85);
    --bg-card-hover: rgba(51, 65, 85, 0.9);
    --border-glass: rgba(255, 255, 255, 0.12);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
}

/* --------------------------------------------------------------------------
   2. Reset & Layout Setup
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    opacity: 0.85;
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.page-wrapper {
    flex: 1;
    padding: 2rem;
    margin-top: var(--navbar-height);
}

/* --------------------------------------------------------------------------
   3. Glassmorphism Card Utility
   -------------------------------------------------------------------------- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 1.5rem;
    transition: var(--transition-fast);
}

.glass-card:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

/* --------------------------------------------------------------------------
   4. Navbar Component
   -------------------------------------------------------------------------- */
.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--navbar-height);
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    transition: left 0.3s ease;
}

.navbar-brand-mobile {
    display: none;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
}

.nav-icon-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--status-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

.wallet-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* User Profile Pill */
.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   5. Sidebar Component
   -------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 1010;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo i {
    font-size: 2rem;
    background: #F97316;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.sidebar-menu a i {
    font-size: 1.15rem;
    width: 24px;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: #F97316;
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.35);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* --------------------------------------------------------------------------
   6. Buttons & Forms
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* --------------------------------------------------------------------------
   7. Status Badges & Queue Badges
   -------------------------------------------------------------------------- */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-pending {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-printing {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --------------------------------------------------------------------------
   8. Grid & Utilities
   -------------------------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.gradient-header {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

/* Alerts Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.alert-success { background: rgba(16, 185, 129, 0.2); border: 1px solid var(--status-green); color: #065f46; }
.alert-danger { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--status-red); color: #991b1b; }
.alert-info { background: rgba(59, 130, 246, 0.2); border: 1px solid var(--status-blue); color: #1e40af; }
.alert-warning { background: rgba(245, 158, 11, 0.2); border: 1px solid var(--status-orange); color: #92400e; }

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.footer {
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-glass);
    background: var(--bg-surface);
}

/* --------------------------------------------------------------------------
   10. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .top-navbar {
        left: 0;
    }
    .navbar-brand-mobile {
        display: block;
    }
    .grid-4, .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .page-wrapper {
        padding: 1rem;
    }
}

/* Sidebar Collapse (Desktop) */
@media (min-width: 993px) {
    body.sidebar-collapsed .sidebar {
        width: 85px;
    }
    body.sidebar-collapsed .sidebar .logo-text {
        display: none;
    }
    body.sidebar-collapsed .sidebar-menu a span {
        display: none;
    }
    body.sidebar-collapsed .sidebar-menu a {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    body.sidebar-collapsed .sidebar-footer a {
        padding: 0.6rem 0;
        font-size: 0; /* hides text, but icon remains if we handle it */
    }
    body.sidebar-collapsed .sidebar-footer a i {
        font-size: 1rem;
        margin: 0;
    }
    body.sidebar-collapsed .sidebar-menu a i {
        margin: 0;
    }
    body.sidebar-collapsed .main-content {
        margin-left: 85px;
    }
    body.sidebar-collapsed .top-navbar {
        left: 85px;
    }
}
