/* assets/css/style.css */

/* Core Design System & Theme Variables */
:root {
    --primary-color: #0f172a; /* Slate 900 */
    --secondary-color: #2563eb; /* Blue 600 */
    --accent-color: #f59e0b; /* Amber 500 */
    --success-color: #10b981; /* Emerald 500 */
    --danger-color: #ef4444; /* Red 500 */
    --info-color: #06b6d4; /* Cyan 500 */
    --body-bg: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    --transition-speed: 0.3s;
}

/* Base Styles */
body {
    background-color: var(--body-bg);
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-speed) ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary-color);
}

/* Force headings to inherit color inside text-white, text-light, or colored cards/alerts */
.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6,
.text-light h1, .text-light h2, .text-light h3, .text-light h4, .text-light h5, .text-light h6,
.bg-gradient-primary h1, .bg-gradient-primary h2, .bg-gradient-primary h3, .bg-gradient-primary h4, .bg-gradient-primary h5, .bg-gradient-primary h6,
.bg-gradient-secondary h1, .bg-gradient-secondary h2, .bg-gradient-secondary h3, .bg-gradient-secondary h4, .bg-gradient-secondary h5, .bg-gradient-secondary h6,
.bg-success h1, .bg-success h2, .bg-success h3, .bg-success h4, .bg-success h5, .bg-success h6,
.bg-danger h1, .bg-danger h2, .bg-danger h3, .bg-danger h4, .bg-danger h5, .bg-danger h6,
.bg-warning h1, .bg-warning h2, .bg-warning h3, .bg-warning h4, .bg-warning h5, .bg-warning h6 {
    color: inherit !important;
}
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--primary-color);
}

/* Glassmorphism Cards & Containers */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    border-radius: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

.dashboard-stat-card {
    border-left: 5px solid var(--stat-color, var(--secondary-color));
}

/* Desktop Sidebar Layout */
.desktop-layout {
    display: flex;
    min-height: 100vh;
}

.desktop-sidebar {
    width: 260px;
    background-color: var(--primary-color);
    color: #f8fafc;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed) ease;
    overflow-y: auto;
}

/* Custom scrollbar for dark desktop-sidebar */
.desktop-sidebar::-webkit-scrollbar {
    width: 5px;
}
.desktop-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.desktop-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.desktop-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.desktop-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
    color: #ffffff;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(248, 250, 252, 0.7);
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

.sidebar-nav-item a i {
    font-size: 1.2rem;
}

.sidebar-nav-item a:hover,
.sidebar-nav-item.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.desktop-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Mobile Screen Layout */
.mobile-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px; /* Spacer for bottom nav */
}

.mobile-header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-header-brand {
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-content {
    flex-grow: 1;
    padding: 16px;
}

/* Mobile Sticky Bottom Nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
}

.mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.mobile-bottom-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.mobile-bottom-item:hover,
.mobile-bottom-item.active {
    color: var(--secondary-color);
}

.mobile-bottom-item.active i {
    transform: translateY(-2px);
}

/* Beautiful Interactive Custom Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

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

.btn-outline-primary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--secondary-color) !important;
    color: #ffffff !important;
    border: 1px solid var(--secondary-color) !important;
    border-radius: 8px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 8px !important;
}

table.dataTable {
    border-collapse: collapse !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

table.dataTable thead th {
    background-color: var(--primary-color);
    color: #ffffff !important;
    padding: 12px 16px !important;
    font-weight: 600;
    border-bottom: none !important;
}

table.dataTable tbody td {
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* SweetAlert2 Styling */
.swal2-popup {
    border-radius: 16px !important;
    font-family: inherit !important;
}

.swal2-confirm {
    background-color: var(--secondary-color) !important;
    border-radius: 8px !important;
}

.swal2-deny {
    background-color: var(--primary-color) !important;
    border-radius: 8px !important;
}

/* Card Gradient Themes */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e293b 100%) !important;
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1d4ed8 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #047857 100%) !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #b91c1c 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--accent-color) 0%, #d97706 100%) !important;
}

/* Utility classes */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-color);
}

.text-xs {
    font-size: 0.75rem;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
}

/* Sidebar Backdrop for Responsive Sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* Responsive Desktop Sidebar under 992px */
@media (max-width: 991.98px) {
    .desktop-sidebar {
        transform: translateX(-100%);
    }
    
    .desktop-sidebar.show-sidebar {
        transform: translateX(0);
    }
    
    .desktop-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }
    
    .desktop-header {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
}

