@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5; /* Indigo */
    --primary-hover: #4338CA;
    --secondary-color: #10B981; /* Emerald */
    --accent-color: #F59E0B; /* Amber */
    --bg-color: #F8FAFC; /* Slate 50 */
    --surface-color: #FFFFFF;
    --text-primary: #0F172A; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --border-color: #E2E8F0; /* Slate 200 */
    
    /* Bootstrap overrides */
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 79, 70, 229;
    --bs-body-font-family: 'Inter', sans-serif;
    --bs-body-bg: var(--bg-color);
    --bs-body-color: var(--text-primary);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03) !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.navbar .navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.navbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Elevated Cards */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Premium Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

/* Outline Buttons */
.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

/* Sidebar Styling */
.sidebar .list-group-item {
    border: none;
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.3rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
}

.sidebar .list-group-item i {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.sidebar .list-group-item:hover {
    background-color: rgba(79, 70, 229, 0.04);
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar .list-group-item:hover i {
    color: var(--primary-color);
}

.sidebar .list-group-item.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sidebar .list-group-item.active i {
    color: white;
}

.sidebar .list-group-item.bg-dark {
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
}

.sidebar .list-group-item.bg-dark i {
    color: var(--primary-color) !important;
}

/* Table Styling */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.8);
}

/* Form inputs */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: var(--surface-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

/* --- Responsive Adjustments --- */

/* Mobile (below 768px) */
@media (max-width: 767.98px) {
    .navbar-brand span {
        font-size: 0.75rem !important;
        white-space: normal !important;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .sidebar {
        margin-bottom: 1.5rem;
    }

    .offcanvas-md.offcanvas-start {
        border-radius: 0 16px 16px 0 !important;
        max-width: 80%;
    }

    .offcanvas-md .offcanvas-body {
        padding: 1.5rem !important;
    }
    
    .sidebar .list-group-item {
        padding: 0.75rem 1rem;
    }

    .sidebar .list-group-item:hover {
        transform: none; /* Disable hover translation on mobile */
    }

    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }

    /* Stack date filters */
    .dashboard-filter-form {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .dashboard-filter-form input {
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }

    /* Tables on mobile */
    .table-responsive {
        border-radius: 12px;
        border: 1px solid var(--border-color);
    }
    
    .table th, .table td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* Feedback Matrix Adjustments (Global for consistent UX) */
.feedback-table {
    min-width: 800px; /* Force minimum scrollable width to prevent squashing */
}

.feedback-table th:first-child, 
.feedback-table td:first-child {
    min-width: 300px; /* Give question plenty of room */
    white-space: normal !important;
}

.feedback-table th:not(:first-child), 
.feedback-table td:not(:first-child) {
    min-width: 100px; /* Ensure rating columns remain readable */
    text-align: center;
}

/* Tablets (768px to 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        font-size: 0.9rem;
    }
    
    .sidebar .list-group-item {
        padding: 0.75rem 1rem;
    }
}
