/* Custom styling to bring premium aesthetics to Bootstrap 5 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #121829;
    --bg-card: rgba(22, 30, 49, 0.65);
    --bg-card-hover: rgba(29, 39, 64, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #f43f5e;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .display-font {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Glassmorphism Cards */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color) !important;
    border-radius: 14px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
}

.card-glass:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    transform: translateY(-2px);
}

/* Sidebar design */
.sidebar {
    width: 260px;
    background: rgba(13, 19, 33, 0.9);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 24px;
}

.main-content {
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 22px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-link-custom:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(4px);
}

.nav-link-custom.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Inputs & Form Controls overrides */
.form-control, .form-select {
    background-color: rgba(10, 14, 26, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(10, 14, 26, 0.8) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.2) !important;
    outline: 0;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

/* Tables Customizations */
.table-glass {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.table-glass table {
    margin-bottom: 0;
}

.table-glass th {
    background: rgba(13, 19, 33, 0.8) !important;
    color: var(--text-secondary) !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color) !important;
}

.table-glass td {
    background: transparent !important;
    color: var(--text-primary) !important;
    padding: 16px;
    border-bottom: 1px solid var(--border-color) !important;
    vertical-align: middle;
}

.table-glass tr:last-child td {
    border-bottom: none !important;
}

.table-glass tr:hover td {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Badges */
.badge-custom {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.badge-primary { background: rgba(99, 102, 241, 0.15) !important; color: var(--primary) !important; }
.badge-secondary { background: rgba(255, 255, 255, 0.08) !important; color: var(--text-secondary) !important; }
.badge-success { background: rgba(16, 185, 129, 0.15) !important; color: var(--success) !important; }
.badge-warning { background: rgba(245, 158, 11, 0.15) !important; color: var(--warning) !important; }
.badge-danger { background: rgba(244, 63, 94, 0.15) !important; color: var(--danger) !important; }

/* Buttons */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 20px;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 20px;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Modals Override */
.modal-content-glass {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: var(--box-shadow) !important;
    backdrop-filter: blur(20px) !important;
}

.modal-header, .modal-footer {
    border-color: var(--border-color) !important;
}

/* Pop-up Notification Container */
.notifications-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
}

.popup-toast {
    background: rgba(18, 24, 41, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--warning);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.popup-toast::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--warning);
}

.popup-toast.critical {
    border-color: var(--danger);
}
.popup-toast.critical::after {
    background: var(--danger);
}

.popup-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    padding: 2px;
}

.popup-toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 20px 10px;
    }
    .sidebar .logo-text, .sidebar span, .sidebar .sidebar-footer {
        display: none;
    }
    .main-content {
        margin-left: 80px;
        padding: 24px;
    }
}
