/* ============================================================
   Modern Admin Dashboard - Custom CSS
   ============================================================ */

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f3f4f6;
    --dark-bg: #1e293b;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
}

/* ============================================================
   Global Styles
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ============================================================
   KPI Card Styles
   ============================================================ */

.kpi-card {
    position: relative;
    perspective: 1000px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 116, 139, 0.5);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 160px;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.kpi-card:hover {
    border-color: rgba(59, 130, 246, 0.7);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2), 0 4px 6px rgba(0, 0, 0, 0.1);
}

.kpi-card .counter-value {
    display: inline-block;
    font-weight: 700;
    font-size: 1.875rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   Status Card Styles
   ============================================================ */

.status-card {
    position: relative;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 116, 139, 0.5);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 160px;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 0;
}

.status-card:hover {
    border-color: rgba(59, 130, 246, 0.7);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
}

.status-card a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    height: 100%;
}

.status-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
    text-transform: none;
    letter-spacing: 0.5px;
}

.status-card p {
    font-size: 0.875rem;
    color: #cbd5e1;
    opacity: 1;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ============================================================
   Table Styles
   ============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: rgba(51, 65, 85, 0.3);
    padding: 16px 24px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

tbody td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.2);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   Button Styles
   ============================================================ */

button, a.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    overflow: hidden;
}

button:hover, a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

button:active, a.btn:active {
    transform: translateY(0);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ============================================================
   Navigation & Header
   ============================================================ */

.sticky.top-0 {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   Gradient Backgrounds
   ============================================================ */

.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-slate-900 {
    --tw-gradient-from: #0f172a;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(15, 23, 42, 0));
}

.via-slate-800 {
    --tw-gradient-stops: var(--tw-gradient-from), #1e293b, var(--tw-gradient-to, rgba(30, 41, 59, 0));
}

.to-slate-900 {
    --tw-gradient-to: #0f172a;
}

/* ============================================================
   Animation Classes
   ============================================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideIn {
    animation: slideIn 0.5s ease-out forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================
   Scrollbar Styles
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* ============================================================
   Responsive Design
   ============================================================ */

@media (max-width: 1024px) {
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-5 {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    thead th {
        padding: 12px 16px;
        font-size: 0.7rem;
    }
    
    tbody td {
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    .overflow-x-auto {
        font-size: 0.875rem;
    }
    
    thead th {
        padding: 10px 12px;
        font-size: 0.65rem;
    }
    
    tbody td {
        padding: 10px 12px;
    }
    
    .kpi-card {
        padding: 16px;
    }
    
    .kpi-card .counter-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .p-6 {
        padding: 1rem !important;
    }
    
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    thead th {
        padding: 8px 10px;
        font-size: 0.6rem;
    }
    
    tbody td {
        padding: 8px 10px;
    }
    
    .flex.gap-2 {
        gap: 0.5rem !important;
    }
}

/* ============================================================
   Accessibility
   ============================================================ */

a:focus, button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================================
   Utility Classes
   ============================================================ */

.glass-effect {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.smooth-transition {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Enhanced Table Styling */
table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.25) !important;
}

table td {
    vertical-align: middle;
}

/* Enhanced Badge Styling */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

/* Section Headers */
h2.section-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.section-subheader {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* ============================================================
   Dark Mode Support
   ============================================================ */

@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}

/* ============================================================
   Printing Styles
   ============================================================ */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none;
    }
}
