/* Tasheel Dashboard - Custom Styles */

/* ===== Base Styles ===== */
:root {
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --sidebar: #1E293B;
    --background: #F8FAFC;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

/* ===== Navigation ===== */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #94A3B8;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

/* ===== Cards ===== */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-static {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
}

/* ===== KPI Cards ===== */
.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, transparent 100%);
    border-radius: 0 0 0 100%;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.status-badge.pulse {
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== Progress Bar ===== */
.progress-bar {
    height: 8px;
    background: #E2E8F0;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 1s ease-out;
}

/* ===== Progress Stepper ===== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.stepper-line {
    position: absolute;
    top: 20px;
    right: 40px;
    left: 40px;
    height: 2px;
    background: #E2E8F0;
}

.stepper-line-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease-out;
}

.stepper-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stepper-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #E2E8F0;
    transition: all 0.3s ease;
}

.stepper-circle.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.stepper-circle.active {
    border-color: var(--primary);
    color: var(--primary);
    animation: pulse-step 2s ease-in-out infinite;
}

@keyframes pulse-step {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

/* ===== Document Grid ===== */
.doc-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 2px dashed #E2E8F0;
    background: #F8FAFC;
    transition: all 0.3s ease;
}

.doc-card.received {
    border-style: solid;
    border-color: #10B981;
    background: #ECFDF5;
}

.doc-card.missing {
    border-color: #EF4444;
    background: #FEF2F2;
}

.doc-card.expired {
    border-color: #F59E0B;
    background: #FFFBEB;
}

/* ===== Activity Timeline ===== */
.timeline-item {
    position: relative;
    padding-right: 2rem;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #E2E8F0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    right: 0;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

/* ===== Kanban Board ===== */
.kanban-column {
    min-width: 300px;
    flex-shrink: 0;
}

.kanban-header {
    padding: 1rem;
    border-radius: 0.75rem 0.75rem 0 0;
    font-weight: 600;
}

.kanban-cards {
    padding: 0.5rem;
    min-height: 400px;
    background: #F8FAFC;
    border-radius: 0 0 0.75rem 0.75rem;
}

.kanban-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-right: 3px solid var(--primary);
    transition: all 0.2s ease;
}

.kanban-card:hover {
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== Charts ===== */
.chart-container {
    position: relative;
    height: 300px;
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Stagger animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.375rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Toast Notifications ===== */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.success { border-right: 4px solid var(--success); }
.toast.warning { border-right: 4px solid var(--warning); }
.toast.error { border-right: 4px solid var(--danger); }
.toast.info { border-right: 4px solid var(--primary); }

/* ===== Empty State ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #64748B;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar-open #sidebar {
        transform: translateX(0);
    }
}

@media (max-width: 640px) {
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* ===== Table Styles ===== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: #F8FAFC;
    padding: 0.75rem 1rem;
    text-align: right;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #E2E8F0;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #E2E8F0;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #F8FAFC;
}

/* ===== Filter Pills ===== */
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #E2E8F0;
    background: white;
    color: #64748B;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===== Search Input ===== */
.search-input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    width: 100%;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}
