@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Modern Dashboard Styles - Inspired by Hogo Template */
:root {
    --primary-color: #1d1f9c;
    --primary-light: #e0e7ff;
    --primary-dark: #4f46e5;
    --secondary-color: #f8fafc;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--gray-800);
}

.bg-gradient-purple {
    background: linear-gradient(135deg, var(--primary-color), #9333ea);
    
}

.text-primary {
    color: var(--primary-color);
}

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

.border-primary {
    border-color: var(--primary-color);
}

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

/* Custom button styles */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: hsl(262, 90%, 45%);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

/* Modern Card styles */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 1rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    margin-top: 1rem;
}

/* Navigation styles */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px hsla(262, 90%, 50%, 0.1);
}

.form-input.error {
    border-color: var(--danger-color);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Modern Dashboard Stats */
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--info-color));
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary-color);
}

.stat-icon.success {
    background: #d1fae5;
    color: var(--success-color);
}

.stat-icon.warning {
    background: #fef3c7;
    color: var(--warning-color);
}

.stat-icon.danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.stat-icon.info {
    background: #dbeafe;
    color: var(--info-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Modern Dashboard Layout */
.dashboard-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: 0 0 1rem 1rem;
    box-shadow: var(--shadow-sm);
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
    font-weight: 400;
}

/* Modern Grid Layout */
.dashboard-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.dashboard-grid-2 {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.dashboard-grid-3 {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Modern List Items */
.list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.list-item:hover {
    background: white;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Modern Progress Indicators */
.progress-ring {
    width: 4rem;
    height: 4rem;
    position: relative;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 4;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Modern Badge Variants */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-modern.primary {
    background: var(--primary-light);
    color: var(--primary-color);
}

.badge-modern.success {
    background: #d1fae5;
    color: var(--success-color);
}

.badge-modern.warning {
    background: #fef3c7;
    color: var(--warning-color);
}

.badge-modern.danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.badge-modern.info {
    background: #dbeafe;
    color: var(--info-color);
}

/* Modern Sidebar */
.sidebar-modern {
    background: white;
    border-right: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

.nav-modern {
    padding: 1rem;
}

.nav-item-modern {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.75rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item-modern:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-item-modern.active {
    background: var(--primary-color);
    color: white;
}

.nav-item-modern svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
}

/* Dynamic Progress Ring Colors */
.progress-ring-fill.phase-1 { stroke: #ef4444; }
.progress-ring-fill.phase-2 { stroke: #f59e0b; }
.progress-ring-fill.phase-3 { stroke: #3b82f6; }
.progress-ring-fill.phase-4 { stroke: #10b981; }
.progress-ring-fill.phase-5 { stroke: #8b5cf6; }

/* Responsive Design Improvements */
@media (max-width: 1024px) {
    .dashboard-grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .list-item {
        padding: 0.75rem;
    }
}

/* Enhanced Hover Effects */
.stat-card:hover .stat-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.card:hover .card-header h2 {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Focus States for Accessibility */
.btn-primary:focus,
.nav-item-modern:focus,
.list-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sidebar-modern,
    .nav-modern,
    .btn-primary {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .stat-card {
        break-inside: avoid;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--gray-700);
    background-color: var(--gray-100);
}

.modal-body {
    padding: 1rem 1.5rem 1.5rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}