/* ============================================
   LEARNRAIL WEB APP STYLES
   ============================================ */

/* Design Tokens - Matching Landing Page */
:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1F2937;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #D97706 100%);
    --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);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition: all 0.3s ease;
    --sidebar-width: 280px;
    --header-height: 64px;
    --mobile-nav-height: 72px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--gray-700);
    line-height: 1.6;
    background: var(--gray-50);
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-bottom: 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--gray-500); }
.text-success { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-400); }
.text-white { color: var(--white); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* ============================================
   APP LAYOUT
   ============================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-logo img {
    height: 36px;
}

.sidebar-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-item span {
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-100);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: 10px 16px 10px 40px;
    background: var(--gray-100);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.header-icon {
    position: relative;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.header-icon:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.header-icon .notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 24px;
}

.page-content.no-padding {
    padding: 0;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 8px 16px;
    z-index: 100;
}

.mobile-nav-items {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--gray-500);
    text-decoration: none;
    transition: var(--transition);
}

.mobile-nav-item i {
    font-size: 1.5rem;
}

.mobile-nav-item span {
    font-size: 0.625rem;
    font-weight: 500;
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient);
    color: var(--white);
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-success {
    background: var(--gradient-secondary);
    color: var(--white);
    border: none;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: none;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

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

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 6px;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input,
.form-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: visible;
}

.card .table-responsive {
    overflow-x: auto;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* Stat Card */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stat-card-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-card-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.stat-card-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
}

.stat-card-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Course Card */
.course-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    display: block;
}

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

.course-card-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.course-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.course-card-badge.ai-badge {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-card-badge.ai-badge i {
    font-size: 0.875rem;
}

.ai-course-placeholder {
    width: 100%;
    height: 100%;
    min-height: 160px;
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 50%, #4F46E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-course-placeholder i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

.course-card-body {
    padding: 16px;
}

.course-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-instructor {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.course-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.course-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-card-meta i {
    color: var(--accent);
}

/* Goal Card */
.goal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.goal-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.goal-card-date {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.goal-card-progress {
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.goal-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
}

/* ============================================
   LISTS & TABLES
   ============================================ */
.list {
    list-style: none;
}

.list-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.list-item:last-child {
    border-bottom: none;
}

.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

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

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--gray-50);
}

.table td {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================
   AVATARS
   ============================================ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.avatar-xl {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid var(--white);
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ============================================
   ALERTS & TOASTS
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1E40AF;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.toast-container {
    position: fixed;
    top: 24px;
    right: 16px;
    left: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 0;
    max-width: 400px;
    margin-left: auto;
    pointer-events: auto;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.toast-exit {
    animation: slideOut 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   CHAT INTERFACE
   ============================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 48px);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    max-width: 80%;
    display: flex;
    gap: 12px;
}

.chat-message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.chat-message-content {
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.chat-message.assistant .chat-message-content {
    background: var(--white);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}

.chat-message.user .chat-message-content {
    background: var(--gradient);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    padding: 16px 24px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.chat-input-form {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 14px 20px;
    background: var(--gray-100);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray-400);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }

.p-0 { padding: 0; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

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

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.cursor-pointer { cursor: pointer; }

/* Grid System */
.grid {
    display: grid;
    gap: 24px;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Stats Grid - Responsive Dashboard Layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stats-grid .stat-card {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 16px;
    }

    .stats-grid .stat-card-icon {
        margin-bottom: 0;
    }

    .stats-grid .stat-card-value {
        font-size: 1.25rem;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when sidebar is open (mobile) */
body.sidebar-open {
    overflow: hidden;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Prevent horizontal scroll on body */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.app-shell {
    overflow-x: hidden;
    max-width: 100%;
}

/* Allow table scrolling inside page content */
.page-content .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
    width: 100%;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }

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

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

    /* Force inline grid layouts to stack on tablet and below */
    .grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .menu-toggle {
        display: block;
    }

    .header-search {
        display: none;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }

    .page-content {
        padding: 16px;
        padding-bottom: calc(var(--mobile-nav-height) + 16px);
        max-width: 100%;
        box-sizing: border-box;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .chat-message {
        max-width: 90%;
    }

    /* Fix scroll container to not cause page overflow */
    .scroll-container {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
        max-width: 100%;
    }

    /* Force all inline grid layouts with fixed px columns to stack on mobile */
    .grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Ensure nothing overflows the screen */
    .card {
        max-width: 100% !important;
        overflow-x: auto;
        box-sizing: border-box;
    }
    .card-body,
    .card-header,
    form,
    .btn-block {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Smaller course cards on mobile */
    .course-card.compact {
        width: 220px !important;
        min-width: 220px;
    }

    /* Continue learning card - make responsive */
    .card-body .d-flex.gap-4.items-center {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .card-body .d-flex.gap-4.items-center > img {
        width: 100% !important;
        height: 140px !important;
    }

    .card-body .d-flex.gap-4.items-center .btn {
        width: 100%;
        margin-top: 8px;
    }

    .card-body .d-flex.gap-4.items-center .progress-bar {
        max-width: 100% !important;
    }

    /* Quick actions grid - 2 columns on mobile */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quick-action {
        padding: 16px 12px;
    }

    .quick-action-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .quick-action span {
        font-size: 0.75rem;
    }
}

/* ============================================
   AUTH LAYOUT
   ============================================ */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    text-decoration: none;
}

.auth-logo img {
    height: 40px;
}

.auth-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--gray-500);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */
.admin-sidebar {
    background: var(--gray-900);
}

.admin-sidebar .sidebar-header {
    border-color: var(--gray-800);
}

.admin-sidebar .sidebar-logo span {
    color: var(--white);
}

.admin-sidebar .nav-section-title {
    color: var(--gray-500);
}

.admin-sidebar .nav-item {
    color: var(--gray-400);
}

.admin-sidebar .nav-item:hover {
    background: var(--gray-800);
    color: var(--white);
}

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

.admin-sidebar .sidebar-footer {
    border-color: var(--gray-800);
}

.admin-sidebar .sidebar-user {
    background: var(--gray-800);
}

.admin-sidebar .sidebar-user-name {
    color: var(--white);
}

.admin-sidebar .sidebar-user-role {
    color: var(--gray-400);
}

/* Quick Actions Grid */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: var(--transition);
}

.quick-action:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.quick-action-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 1.5rem;
}

.quick-action-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.quick-action-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.quick-action-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
}

.quick-action-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.quick-action span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.section-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

/* Horizontal Scroll Container */
.scroll-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

.scroll-container > * {
    flex-shrink: 0;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover {
    color: var(--gray-900);
}

.tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(8px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.875rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-item i {
    width: 20px;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 8px 0;
}

/* ============================================
   PAYMENT METHOD CARDS (Admin Settings)
   ============================================ */
.payment-method-card {
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.payment-method-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Admin Settings Responsive */
@media (max-width: 1024px) {
    .settings-page-grid {
        grid-template-columns: 1fr !important;
    }

    .settings-nav-sidebar {
        position: static;
        margin-bottom: 24px;
    }
}

/* Leaderboard Styles */
.leaderboard-rank {
    width: 48px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.leaderboard-item:hover {
    background: var(--gray-50);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item.current-user {
    background: rgba(99, 102, 241, 0.05);
}

.leaderboard-medal {
    font-size: 1.75rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ============================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ============================================ */

/* Two-column layout with sidebar - make responsive */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
}

@media (max-width: 1024px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
    }

    .layout-with-sidebar > div:last-child {
        order: -1;
    }
}

/* Goals page specific mobile styles */
@media (max-width: 768px) {
    /* Two-column grid inline styles to single column */
    .grid[style*="grid-template-columns: 1fr 350px"],
    .grid[style*="grid-template-columns: 1fr 300px"] {
        grid-template-columns: 1fr !important;
    }

    /* Reorder: show sidebar (partner) first on mobile for goals page */
    .grid[style*="grid-template-columns: 1fr 350px"] > div:last-child,
    .grid[style*="grid-template-columns: 1fr 300px"] > div:last-child {
        order: -1;
    }

    /* Sticky sidebar should not be sticky on mobile */
    .card[style*="position: sticky"] {
        position: static !important;
    }

    /* Goal cards - single column */
    .goal-card {
        padding: 16px;
    }

    .goal-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .goal-card-header .badge {
        margin-top: 4px;
    }

    /* Modal adjustments for mobile */
    .modal {
        width: 95%;
        max-height: 80vh;
        margin: 0 auto;
    }

    .modal-body .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Partner stats grid */
    .grid.grid-cols-3.gap-2 {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .grid.grid-cols-3.gap-2 > div {
        padding: 8px !important;
    }

    .grid.grid-cols-3.gap-2 .text-lg {
        font-size: 1rem;
    }

    /* Button adjustments */
    .btn-block {
        padding: 14px 20px;
    }

    /* Header improvements */
    .app-header {
        padding: 0 16px;
    }

    .page-title {
        font-size: 1.125rem;
    }

    /* Card header flex wrap */
    .card-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .card-header .card-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Form improvements */
    .form-group {
        margin-bottom: 16px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Alert and toast mobile */
    .toast-container {
        top: auto;
        bottom: calc(var(--mobile-nav-height) + 16px);
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Avatar sizing on mobile */
    .avatar-lg {
        width: 56px;
        height: 56px;
    }

    .avatar-xl {
        width: 72px;
        height: 72px;
        font-size: 1.5rem;
    }

    /* Table responsive improvements */
    .table-responsive {
        margin: 0 -16px;
        padding: 0;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: 12px;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    /* Chat improvements */
    .chat-container {
        height: calc(100vh - var(--header-height) - var(--mobile-nav-height) - 32px);
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-message {
        max-width: 85%;
    }

    .chat-input-container {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    /* Dropdown adjustments */
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        overflow-y: auto;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .dropdown.open .dropdown-menu {
        transform: translateY(0);
    }

    .dropdown-item {
        padding: 14px 16px;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .page-content {
        padding: 12px;
        padding-bottom: calc(var(--mobile-nav-height) + 12px);
    }

    .card-body {
        padding: 12px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.8125rem;
    }

    .btn-lg {
        padding: 12px 24px;
    }

    h1 { font-size: 1.375rem; }
    h2 { font-size: 1.125rem; }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-action {
        padding: 12px 8px;
    }

    .quick-action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .quick-action span {
        font-size: 0.6875rem;
    }
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    }

    .page-content {
        padding-bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom));
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .nav-item {
        min-height: 48px;
    }

    .mobile-nav-item {
        min-width: 48px;
        padding: 8px 16px;
    }

    /* Remove hover effects on touch */
    .course-card:hover,
    .quick-action:hover,
    .btn-primary:hover:not(:disabled) {
        transform: none;
    }

    /* Active states for touch */
    .btn:active:not(:disabled) {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .course-card:active,
    .quick-action:active {
        transform: scale(0.98);
    }
}

/* Career assessment mobile styles */
@media (max-width: 768px) {
    .grid[style*="grid-template-columns: 1fr 350px"] .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    /* Career path cards */
    .career-path-card {
        padding: 16px;
    }

    .career-path-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .career-path-card h4 {
        font-size: 0.9375rem;
    }

    /* Skills badges */
    .skills-grid {
        gap: 8px;
    }

    .skill-badge {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Course items in recommendations */
    .course-item {
        padding: 12px;
        flex-wrap: wrap;
    }

    .course-thumbnail {
        width: 60px;
        height: 45px;
    }

    .course-info h4 {
        font-size: 14px;
    }
}

/* Search filters form - responsive */
.search-filters-form {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    min-width: 200px;
}

.filter-selects {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-selects .form-select {
    width: auto;
    min-width: 130px;
}

.search-btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .search-filters-form {
        flex-direction: column;
        gap: 12px;
    }

    .search-input-wrapper {
        width: 100%;
        min-width: 100%;
    }

    .filter-selects {
        width: 100%;
    }

    .filter-selects .form-select {
        flex: 1;
        min-width: calc(50% - 6px);
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 375px) {
    .filter-selects {
        flex-direction: column;
        gap: 8px;
    }

    .filter-selects .form-select {
        width: 100%;
        min-width: 100%;
    }
}

/* Page header actions */
.page-header-actions {
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 480px) {
    .page-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-actions .header-text {
        margin-bottom: 8px;
    }

    .page-header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Hide button text on very small screens if needed */
    .page-header-actions .btn-text {
        display: inline;
    }
}

/* Landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-nav {
        height: 56px;
        padding: 4px 16px;
    }

    .mobile-nav-item {
        flex-direction: row;
        gap: 8px;
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
    }

    .mobile-nav-item span {
        font-size: 0.75rem;
    }

    .page-content {
        padding-bottom: calc(56px + 16px);
    }

    .chat-container {
        height: calc(100vh - var(--header-height) - 56px - 16px);
    }
}
