/* style.css - Premium Modern Design System */
@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 {
    /* Color Palette */
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-sidebar: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.15);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.15);
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Layout Wrapper */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand svg {
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.sidebar-brand h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
    padding-left: 20px;
}

.sidebar-item.active a {
    color: var(--text-primary);
    background: linear-gradient(90deg, var(--accent) 0%, rgba(139, 92, 246, 0.2) 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    border-left: 3px solid var(--accent);
}

.sidebar-item.active a svg {
    color: var(--text-primary);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    transition: var(--transition);
    max-width: calc(100% - var(--sidebar-width));
}

/* Header & Typography */
.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.05);
}

.stat-info h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.purple { background-color: rgba(139, 92, 246, 0.15); color: var(--accent); }
.stat-icon.green { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.amber { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.blue { background-color: rgba(14, 165, 233, 0.15); color: var(--info); }

/* Custom Grid Layouts */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .content-grid.two-cols {
        grid-template-columns: 350px minmax(0, 1fr);
    }
}

/* Glassmorphic Panel / Card styling */
.panel {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.panel-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

/* Forms Styling */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

select.form-control option {
    background-color: #0f172a; /* Dark slate matching the sidebar background */
    color: var(--text-primary); /* Light text for high contrast */
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-success {
    background-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    background-color: #059669;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Tables styling */
.table-container {
    overflow-x: auto;
    width: 100%;
    margin-top: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.table th {
    padding: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.01);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tr {
    transition: var(--transition);
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Custom Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background-color: var(--warning-bg);
    color: var(--warning);
}

.badge-collected {
    background-color: var(--success-bg);
    color: var(--success);
}

.badge-dispatched {
    background-color: var(--info-bg);
    color: var(--info);
}

/* Interactive Actions Panel */
.actions-cell {
    display: flex;
    gap: 8px;
}

/* Status Notifications */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.alert-danger {
    background-color: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Modal Overlay & Modal Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Checkbox Styling inside tables or lists */
.custom-checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

.custom-checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent);
}

.custom-checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent);
    border-color: var(--accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 20px;
    }
    
    .mobile-nav-toggle {
        display: block !important;
    }
}

.mobile-nav-toggle {
    display: none;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    cursor: pointer;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 101;
}

.no-records {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.no-records svg {
    margin-bottom: 12px;
    color: var(--text-muted);
    opacity: 0.5;
}
