/**
 * Smaaklink Admin Modern Theme
 * Overrides and enhancements for a professional look
 */

:root {
    /* Modern Color Palette */
    --primary: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary: #64748b; /* Slate 500 */
    --success: #10b981; /* Emerald 500 */
    --warning: #f59e0b; /* Amber 500 */
    --danger: #ef4444; /* Red 500 */
    
    /* Backgrounds */
    --bg-body: #f3f4f6; /* Gray 100 */
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b; /* Slate 800 */
    
    /* Text */
    --text-main: #111827; /* Gray 900 */
    --text-muted: #6b7280; /* Gray 500 */
    --text-sidebar: #e2e8f0; /* Slate 200 */
    --text-sidebar-muted: #94a3b8; /* Slate 400 */
    
    /* Borders */
    --border-color: #e5e7eb; /* Gray 200 */
    --border-radius: 0.75rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
}

/* Global Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

/* Sidebar Styling */
.admin-sidebar {
    background-color: var(--bg-sidebar);
    border-right: none;
    color: var(--text-sidebar);
    width: 280px;
    transition: all 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-brand-text h1 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.sidebar-brand-text span {
    color: var(--text-sidebar-muted);
    font-size: 0.875rem;
}

.sidebar-nav-title {
    color: var(--text-sidebar-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 1.5rem 1.5rem 0.75rem;
}

.sidebar-nav-item {
    color: var(--text-sidebar);
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    opacity: 0.8;
}

.sidebar-nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
    opacity: 1;
    text-decoration: none;
}

.sidebar-nav-item.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--primary);
    opacity: 1;
}

.sidebar-nav-icon {
    color: var(--text-sidebar-muted);
    margin-right: 0.75rem;
}

.sidebar-nav-item.active .sidebar-nav-icon {
    color: var(--primary);
}

/* Submenu Styling */
.sidebar-nav-submenu {
    background-color: rgba(0,0,0,0.15);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.sidebar-nav-submenu .sidebar-nav-item {
    padding-left: 3.5rem;
    font-size: 0.85rem;
    border-left: none;
}

.sidebar-nav-submenu .sidebar-nav-item:hover {
    background-color: rgba(255,255,255,0.03);
}

.sidebar-nav-submenu .sidebar-nav-item.active {
    background-color: rgba(255,255,255,0.05);
    color: white;
    border-left: none;
}

.sidebar-nav-submenu .sidebar-nav-icon {
    font-size: 0.9em;
}

/* Header Styling */
.admin-header {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    border-bottom: none;
    padding: 1rem 2rem;
}

.admin-breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-main);
    font-weight: 500;
}

/* Card Styling */
.card {
    background-color: var(--bg-card);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Button Styling */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 2px 0 rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Table Styling */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f9fafb;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.table td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

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

/* Form Styling */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: var(--border-color);
    padding: 0.625rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Badge Styling */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    border-radius: 9999px;
}

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

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

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

/* User Menu */
.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info .user-name {
    font-weight: 600;
    color: var(--text-main);
}

.user-info .user-role {
    color: var(--text-muted);
}

/* Footer Styling */
.admin-footer {
    padding: 1.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background-color: var(--bg-body);
}

.admin-footer a:hover {
    color: var(--primary);
}

/* Page Header */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page-header h1 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

/* Filter Group */
.admin-filter-group {
    display: inline-flex;
    background-color: white;
    padding: 0.25rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.admin-filter-group .btn {
    border: none;
    box-shadow: none;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: transparent;
}

.admin-filter-group .btn:hover {
    color: var(--text-main);
    background-color: var(--bg-body);
}

.admin-filter-group .btn.btn-primary {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
}

/* Outline Button */
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-body);
    border-color: var(--text-muted);
}

/* Mobile Sidebar */
@media (max-width: 992px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 280px;
        box-shadow: var(--shadow-lg);
        display: block !important; /* Ensure it's not hidden by other rules */
    }

    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }

    .mobile-overlay.active {
        display: block;
    }
}

/* Utility Overrides */
.text-3xl { font-size: 1.875rem !important; }
.font-bold { font-weight: 700 !important; }
.text-gray-600 { color: var(--text-muted) !important; }
.mt-xs { margin-top: 0.25rem !important; }
