/* Custom styles supplementing Tailwind CSS */

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

/* Smooth transitions */
*, *::before, *::after {
    transition-property: background-color, border-color, color, box-shadow, opacity;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Card hover effect */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

/* Table row hover */
.data-table tbody tr:hover {
    background-color: #f0f9ff;
}

/* Animated gradient header */
.header-gradient {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 30%, #2563eb 60%, #3b82f6 100%);
}

/* Pulse animation for pending indicators */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Risk indicator */
.risk-high {
    background-color: #fef2f2;
    border-left: 4px solid #dc2626;
}
.risk-medium {
    background-color: #fffbeb;
    border-left: 4px solid #d97706;
}
.risk-low {
    background-color: #f0fdf4;
    border-left: 4px solid #059669;
}

/* Dynamic row animations */
.row-enter {
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.row-exit {
    animation: slideOut 0.2s ease-in forwards;
}
@keyframes slideOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10px); height: 0; }
}

/* Toast notification */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    min-width: 320px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    animation: toastIn 0.3s ease-out;
}
.toast.toast-success { background-color: #059669; color: white; }
.toast.toast-error   { background-color: #dc2626; color: white; }
.toast.toast-info    { background-color: #2563eb; color: white; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Loading spinner */
.spinner {
    border: 3px solid #e2e8f0;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Chart container */
.chart-container {
    position: relative;
    min-height: 300px;
}

/* Form input focus ring */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}
.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger  { background-color: #fee2e2; color: #991b1b; }
.badge-info    { background-color: #dbeafe; color: #1e40af; }

/* Admin shell layout */
.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.25rem 1rem;
}

.admin-brand {
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #f8fafc;
}

.admin-nav {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.7rem;
    font-size: 0.92rem;
    color: #cbd5e1;
}

.admin-nav-link:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #f8fafc;
}

.admin-nav-link.active {
    background: rgba(59, 130, 246, 0.28);
    color: #ffffff;
    border: 1px solid rgba(147, 197, 253, 0.35);
}

.admin-main {
    flex: 1;
    min-width: 0;
}

/* Pagination controls */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.pager .meta {
    font-size: 0.82rem;
    color: #64748b;
}

.pager .actions {
    display: flex;
    gap: 0.5rem;
}

.pager button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.pager button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 1024px) {
    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding-bottom: 0.8rem;
    }

    .admin-nav {
        margin-top: 0.9rem;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Print styles */
@media print {
    .no-print { display: none !important; }
    body { font-size: 12px; }
    .stat-card { box-shadow: none; border: 1px solid #ccc; }
}
