/* ============================================================
   家教巴巴 (TutorBaba) - 主样式表
   安徽省家教服务平台
   响应式Web设计 - PC端和移动端适配
   ============================================================ */

/* === CSS Variables / Design Tokens === */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --secondary: #f59e0b;
    --secondary-light: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;

    --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;

    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    --header-height: 64px;
    --max-width: 1200px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

button { cursor: pointer; border: none; background: none; }

/* === Utility Classes === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.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-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-gray { color: var(--gray-500); }
.text-gray-dark { color: var(--gray-700); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.w-full { width: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-secondary:hover {
    background: var(--primary-bg);
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* === Badges === */
.badge {
    display: inline-flex;
    align-items:center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* === Star Rating === */
.stars { display: inline-flex; gap: 2px; }
.stars .star { color: var(--gray-300); font-size: 1rem; }
.stars .star.filled { color: var(--secondary); }
.stars .star.half { position: relative; color: var(--gray-300); }
.stars .star.half::before {
    content: '\2605';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: var(--secondary);
}

/* === Loading Spinner === */
.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Toast === */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 10000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: var(--white);
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--primary); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--header-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.header-logo .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav a {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.93rem;
    transition: all var(--transition);
}
.header-nav a:hover, .header-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions .btn {
    padding: 8px 18px;
    font-size: 0.9rem;
}

/* User Dropdown */
.user-menu {
    position: relative;
    cursor: pointer;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.user-menu-trigger:hover { background: var(--gray-100); }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-menu .username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition);
}
.user-menu.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: var(--gray-700);
    font-size: 0.9rem;
    transition: all var(--transition);
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.user-dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger:hover { background: #fef2f2; }
.user-dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}
.mobile-menu-toggle span {
    width: 24px; height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all var(--transition);
}
.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

.mobile-filter-toggle { display: none; }
.mobile-bottom-nav { display: none; }
.mobile-bottom-nav a svg { width: 24px; height: 24px; flex-shrink: 0; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.main-content {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* === Page Section === */
.page-section {
    padding: 60px 0;
}

/* === Hero Section === */
.hero {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #ecfeff 100%);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 40px;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* === Search Section === */
.search-section {
    background: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: var(--header-height);
    z-index: 99;
    box-shadow: var(--shadow-sm);
}

.search-box {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

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

.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--gray-50);
}

.search-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.filter-select {
    padding: 12px 36px 12px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--gray-50);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition);
    min-width: 130px;
}

.filter-select:focus {
    border-color: var(--primary);
    background-color: var(--white);
}

/* === Tutor Cards Grid === */
.tutors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 32px 0;
}

.tutor-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 24px;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.tutor-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.tutor-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-bg);
    flex-shrink: 0;
}

.tutor-card-info { flex: 1; min-width: 0; }

.tutor-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.tutor-card-city {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tutor-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--secondary);
    font-weight: 600;
}

.tutor-card-rating .rating-count {
    color: var(--gray-500);
    font-weight: 400;
    font-size: 0.8rem;
}

.tutor-card-subjects {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tutor-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--danger);
}

.tutor-card-price .unit {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--gray-500);
}

.tutor-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.tutor-card-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

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

.tutor-card .verified-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--success);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* === Modals === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease;
}

.modal-lg { max-width: 640px; }

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--gray-500);
    transition: all var(--transition);
}
.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body { padding: 24px 28px; }
.modal-footer {
    padding: 16px 28px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* === Form Styles === */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--gray-50);
}

.form-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

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

.form-select {
    width: 100%;
    padding: 11px 36px 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--gray-50);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-600);
    cursor: pointer;
}

.form-link {
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}
.form-link:hover { text-decoration: underline; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* === Tabs === */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    gap: 0;
    margin-bottom: 24px;
}

.tab-item {
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

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

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 32px 0;
}

.pagination button {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--white);
    font-weight: 600;
    color: var(--gray-600);
    transition: all var(--transition);
}

.pagination button:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}

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

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === Tutor Detail Page === */
.tutor-detail {
    padding: 40px 0;
}

.tutor-profile-header {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 32px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.tutor-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-bg);
}

.tutor-profile-info { flex: 1; }

.tutor-profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.tutor-profile-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.tutor-profile-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tutor-profile-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--danger);
}

/* Detail Sections */
.detail-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.detail-section h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* === Review Section === */
.review-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.review-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.review-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.review-content {
    color: var(--gray-700);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* === Chat / Messages === */
.chat-container {
    display: flex;
    height: calc(100vh - var(--header-height) - 40px);
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-contact-list {
    flex: 1;
    overflow-y: auto;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--gray-50);
}

.chat-contact:hover, .chat-contact.active {
    background: var(--primary-bg);
}

.chat-contact-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.chat-contact-info { flex: 1; min-width: 0; }

.chat-contact-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.chat-contact-preview {
    font-size: 0.8rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-contact .unread-badge {
    width: 20px; height: 20px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-main-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--gray-50);
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.93rem;
    line-height: 1.5;
    word-break: break-word;
}

.message-sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-received {
    align-self: flex-start;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.93rem;
    background: var(--gray-50);
}

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

/* === Profile Page === */
.profile-container {
    padding: 40px 0;
}

.profile-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.profile-cover {
    height: 120px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
}

.profile-info {
    padding: 0 32px 32px;
    position: relative;
}

.profile-large-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--white);
    margin-top: -50px;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* === Orders Page === */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.orders-table th {
    background: var(--gray-50);
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orders-table td {
    padding: 14px 20px;
    font-size: 0.93rem;
    border-top: 1px solid var(--gray-100);
}

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

.orders-table tbody tr {
    cursor: pointer;
    transition: background var(--transition);
}

.order-status {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #dbeafe; color: #1e40af; }
.status-confirmed { background: #e0e7ff; color: #3730a3; }
.status-ongoing { background: #cffafe; color: #155e75; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-refunding { background: #fce7f3; color: #9d174d; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}
.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state h3 {
    font-size: 1.2rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* === Footer === */
.footer {
    background: var(--gray-800);
    color: var(--gray-400);
    padding: 48px 0 24px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
}

.footer p { font-size: 0.9rem; line-height: 1.7; }

.footer h4 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links { display: flex; flex-direction: column; gap: 8px; }

.footer-links a {
    color: var(--gray-400);
    font-size: 0.85rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--white); }

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE DESIGN - Mobile & Tablet
   ============================================================ */

@media (max-width: 1024px) {
    .hero-title { font-size: 2.2rem; }
    .hero-stats { gap: 32px; }
    .tutors-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    :root { --header-height: 56px; }

    .header-nav { display: none; }
    .header-nav.mobile-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
        gap: 4px;
    }
    .header-nav.mobile-open a {
        padding: 12px 16px;
        border-radius: var(--radius);
    }
    .mobile-menu-toggle { display: flex; }

    .hero { padding: 48px 0 40px; }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-stats { gap: 20px; flex-wrap: wrap; }

    .search-box { flex-direction: column; }
    .search-input-wrapper { min-width: 100%; }
    .filter-select { width: 100%; }

    .tutors-grid { grid-template-columns: 1fr; gap: 16px; }

    .tutor-profile-header { flex-direction: column; align-items: center; text-align: center; }
    .tutor-profile-meta { justify-content: center; }
    .tutor-profile-tags { justify-content: center; }

    .chat-container { flex-direction: column; height: auto; }
    .chat-sidebar { width: 100%; max-height: 300px; border-right: none; border-bottom: 1px solid var(--gray-200); }
    .chat-main { min-height: 400px; }

    .form-row { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }

    .modal { max-width: 100%; margin: 10px; border-radius: var(--radius-lg); }
    .modal-body { padding: 20px; }
    .modal-header { padding: 20px 20px 12px; }

    .orders-table { font-size: 0.85rem; }
    .orders-table th, .orders-table td { padding: 10px 12px; }

    .mobile-filter-toggle { display: inline-flex !important; }
    .home-search-desk { display: none !important; }
    .home-search-desk.show-mobile { display: inline-flex !important; }
    .sort-group.show-mobile { display: flex !important; }

    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        border-top: 1px solid var(--gray-200);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
        z-index: 1000;
        padding: 6px 0;
        justify-content: space-around;
    }
    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.68rem;
        color: var(--gray-500);
        text-decoration: none;
        padding: 4px 12px;
        gap: 2px;
        border-radius: var(--radius);
    }
    .mobile-bottom-nav a.active { color: var(--primary); font-weight: 600; }
    .mobile-bottom-nav a svg { width: 22px; height: 22px; }
    .main-content { padding-bottom: 70px !important; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.5rem; }
    .hero-stat-number { font-size: 1.5rem; }
    .tutor-card { padding: 16px; }
    .tutor-card-avatar { width: 56px; height: 56px; }
    .btn { padding: 8px 16px; font-size: 0.85rem; }
    .orders-table th:nth-child(4),
    .orders-table td:nth-child(4) { display: none; }
    .orders-table th:nth-child(6),
    .orders-table td:nth-child(6) { display: none; }
    .orders-table th:nth-child(9),
    .orders-table td:nth-child(9) { display: none; }
}

/* ===== Sort Pill Buttons ===== */
.sort-group {
    display: flex;
    gap: 0;
    border: 1px solid var(--gray-200, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-50, #f8fafc);
}
.sort-pill {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--gray-600, #475569);
    transition: all 0.2s;
    border-right: 1px solid var(--gray-200, #e2e8f0);
    white-space: nowrap;
    user-select: none;
    text-align: center;
}
.sort-pill:last-child { border-right: none; }
.sort-pill input[type="radio"] { display: none; }
.sort-pill:hover {
    background: var(--gray-100, #f1f5f9);
    color: var(--primary, #2563eb);
}
.sort-pill.active {
    background: var(--primary, #2563eb);
    color: #fff;
    font-weight: 600;
}
.sort-pill.active:hover {
    background: var(--primary-dark, #1d4ed8);
    color: #fff;
}
