/* Base color system */
:root {
    /* Primary Brand Colors */
    --color-primary: #FF6B00; /* Your existing orange */
    --color-primary-hover: #e65c00;
    
    /* Secondary Colors */
    --color-blue: #2563eb;
    --color-blue-light: #dbeafe;
    --color-blue-dark: #1d4ed8;
    
    /* Status Colors */
    --color-success: #16a34a;
    --color-success-bg: #dcfce7;
    --color-warning: #d97706;
    --color-warning-bg: #fef3c7;
    --color-error: #dc2626;
    --color-error-bg: #fee2e2;
    
    /* Grays */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
}

/* Layout Styles */
.orange-curve {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 0 0 0 100%;
    z-index: -1;
}

body {
    background-color: white;
    min-height: 100vh;
    position: relative;
}

/* Common element styles */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

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

/* Status badges */
.badge-success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.badge-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-error {
    background-color: var(--color-error-bg);
    color: var(--color-error);
}

/* Sidebar Styles */
.sidebar-container {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    transition: all 0.3s;
    opacity: 0;
    transform: translateX(0);
}

.js-loaded .sidebar-container {
    opacity: 1;
}

.sidebar-container.collapsed {
    transform: translateX(-100%);
}

.sidebar {
    height: 100%;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
    display: none;
}

/* Sidebar Toggle Button Styles */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 60;
    transition: all 0.3s;
}

.sidebar-toggle.sidebar-open {
    left: 1rem;
}

/* Overlay styles */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Main content transition */
.main-content {
    transition: margin-left 0.3s;
    min-height: calc(100vh - 4rem); /* Account for potential footer */
}

/* Staff-only element styles */
.staff-only {
    display: none;
}

body[data-user-type="staff"] .staff-only {
    display: block;
}

/* Navigation styles */
.nav-item.active {
    background-color: var(--color-gray-100);
    border-left: 3px solid var(--color-primary);
}

.nav-item.active .nav-link {
    color: var(--color-primary);
    font-weight: 600;
}

/* Form Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 1rem;
}

/* Focus state */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

/* Error state */
input.error,
select.error,
textarea.error {
    border-color: var(--color-error);
}

/* Error messages */
.error-message {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Form labels */
.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Better file inputs */
input[type="file"] {
    padding: 0.5rem;
    border: 1px dashed #e2e8f0;
    background-color: #f8fafc;
}

/* Dashboard Card Styles */
.dashboard-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dashboard-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-700);
}

.dashboard-card-body {
    color: var(--color-gray-600);
}

.dashboard-card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-gray-200);
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

/* Stats card variant */
.stats-card {
    text-align: center;
    padding: 1.25rem;
}

.stats-icon {
    display: inline-flex;
    padding: 1rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.stats-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
}

.stats-label {
    color: var(--color-gray-500);
}

/* Message styles */
.message-alert {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
    background-color: rgba(0, 0, 0, 0.8); /* Default dark background */
}

.message-alert.bg-error,
.message-alert.bg-danger {
    background-color: rgb(239, 68, 68); /* Solid red */
}

.message-alert.bg-success {
    background-color: rgb(16, 185, 129); /* Solid green */
}

.message-alert.bg-warning {
    background-color: rgb(245, 158, 11); /* Solid yellow */
}

.message-alert.bg-info {
    background-color: rgb(59, 130, 246); /* Solid blue */
}

.message-alert.show {
    opacity: 1;
    transform: translateX(0);
}

/* Loading Spinner */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--color-gray-200);
    color: var(--color-gray-700);
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-gray-200);
    color: var(--color-gray-600);
}

.data-table tr:hover {
    background-color: var(--color-gray-50);
}

.data-table .sortable {
    cursor: pointer;
    user-select: none;
}

.data-table .sortable:hover {
    background-color: var(--color-gray-100);
}

.data-table .sortable::after {
    content: '↕';
    display: inline-block;
    margin-left: 0.25rem;
    color: var(--color-gray-400);
}

.data-table .sort-asc::after {
    content: '↑';
    color: var(--color-primary);
}

.data-table .sort-desc::after {
    content: '↓';
    color: var(--color-primary);
}

/* File Upload Styles */
.file-drop-area {
    position: relative;
    border: 2px dashed var(--color-gray-300);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    background-color: var(--color-gray-50);
}

.file-drop-area:hover {
    border-color: var(--color-gray-400);
    background-color: var(--color-gray-100);
}

.file-drop-area .file-input {
    /* Only make the input cover the drop area when it's used inside
       a .file-drop-area container. Avoid applying fullscreen/absolute
       positioning to standalone file inputs used elsewhere on the page. */
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Ensure standalone file inputs keep normal flow and are visible by default */
.file-input:not(.in-drop-area) {
    position: static;
    height: auto;
    width: auto;
    opacity: 1;
    cursor: pointer;
}

.file-label {
    color: var(--color-gray-600);
    pointer-events: none;
}

.file-drop-area.dragover {
    border-color: var(--color-primary);
    background-color: rgba(255, 107, 0, 0.05);
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .sidebar-container {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    }

    .sidebar {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    }

    .sidebar-container.active {
    transform: translateX(0);
    }

    .main-content {
    margin-left: 0 !important;
    }

    .sidebar-toggle {
    z-index: 70;
    }

    .nav-item {
    padding: 0.5rem 0;
    }
    
    .nav-link {
    min-height: 44px; /* Better touch target size */
    padding: 0.5rem;
    }

    .table-container {
    overflow-x: auto;
    }
    
    .data-table th,
    .data-table td {
    white-space: nowrap;
    }
}