/* 
 * DASHBOARD CSS - Optimized and Enhanced
 * Overrides style.css for dashboard pages only
 */

/* 1. RESET for dashboard page only */
body.dashboard-page {
    background: #f5f5f5 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* 2. Main container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: #f5f5f5;
}
.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #f5f5f5;
    position: relative;
}

/* 3. SIDEBAR - Enhanced */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 3px 0 15px rgba(0,0,0,0.1);
    height: 100vh;
}

.sidebar-header {
    padding: 25px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.sidebar nav {
    padding: 15px 0;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 2px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 14px;
}

.nav-link:hover {
    background: rgba(52, 73, 94, 0.7);
    color: white;
    border-left: 4px solid #3498db;
}

.nav-link.active {
    background: rgba(52, 73, 94, 0.9);
    color: white;
    border-left: 4px solid #3498db;
    font-weight: 500;
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 16px;
}
.main-content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    background: #f5f5f5;
    transition: margin-left 0.3s ease;
}

/* 5. HEADER - Enhanced */
.header {
    background: white;
    padding: 18px 30px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    position: relative;
}
.content-section {
    padding: 30px;
    background: #f5f5f5;
    min-height: calc(100vh - 80px);
}

.content-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.3s, box-shadow 0.3s;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.content-card h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card h2 i {
    color: #3498db;
}

/* 7. STATS GRID - Enhanced */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    transition: all 0.3s;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3498db;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

/* 8. BUTTONS - Enhanced */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    color: white;
}

/* 9. TABLES - Enhanced */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

thead {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8fafc;
}

td {
    padding: 15px;
    color: #333;
}

/* 10. FORMS - Enhanced */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: white;
}

/* 11. RESPONSIVE - Enhanced */
@media (max-width: 768px) {
    .sidebar {
        width: 220px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

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

    .menu-toggle {
        display: block !important;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: #3498db;
        color: white;
        border: none;
        padding: 12px;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
        transition: all 0.3s;
    }
    
    .menu-toggle:hover {
        background: #2980b9;
        transform: scale(1.05);
    }
    
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

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

.content-card {
    animation: fadeIn 0.5s ease-out;
}

.stat-card {
    animation: fadeIn 0.5s ease-out;
}

/* 13. SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* 14. UTILITY CLASSES */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

.error {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 20px;
    color: #c00;
    margin: 20px 0;
    border-left: 4px solid #e74c3c;
}

.error h3 {
    margin-top: 0;
    color: #c00;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    color: #155724;
    margin: 20px 0;
    border-left: 4px solid #28a745;
}

.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    color: #856404;
    margin: 20px 0;
    border-left: 4px solid #ffc107;
}

/* 15. MODAL - Enhanced */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 16. DASHBOARD SPECIFIC ENHANCEMENTS */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-subtitle {
    color: #7f8c8d;
    font-size: 15px;
    max-width: 600px;
}

.quick-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.quick-actions .btn {
    flex: 1;
    min-width: 180px;
    justify-content: center;
    padding: 15px;
    font-size: 15px;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s;
}

.activity-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: #e3f2fd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.5;
}

.activity-time {
    color: #7f8c8d;
    font-size: 13px;
}

/* 17. EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #95a5a6;
    margin-bottom: 10px;
}

/* 18. BADGES */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: #e3f2fd;
    color: #3498db;
}

.badge-success {
    background: #d4edda;
    color: #28a745;
}

.badge-warning {
    background: #fff3cd;
    color: #ffc107;
}

.badge-danger {
    background: #f8d7da;
    color: #e74c3c;
}

/* 19. FLEX UTILITIES */
.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* 20. SHADOWS */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.shadow-md {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.shadow-lg {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
