/**
 * Page-specific CSS Fixes
 * This file contains fixes for specific pages that may have styling issues
 */

/* ===== 通用背景和文字颜色修复 ===== */
/* 确保所有页面的背景色和文字颜色正确 */

/* 白色背景页面（登录、注册、仪表盘等） */
body:not(.dark-bg) {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

/* 确保容器背景正确 */
.bg-white {
    background: #ffffff !important;
}

.bg-gray-50 {
    background: #f9fafb !important;
}

.bg-gray-100 {
    background: #f3f4f6 !important;
}

/* 确保文字颜色可读 */
.text-gray-900 {
    color: #111827 !important;
}

.text-gray-800 {
    color: #1f2937 !important;
}

.text-gray-700 {
    color: #374151 !important;
}

.text-gray-600 {
    color: #4b5563 !important;
}

.text-gray-500 {
    color: #6b7280 !important;
}

/* ===== LOGIN & REGISTER PAGE FIXES ===== */
@media (max-width: 768px) {
    /* Ensure login/register containers stay centered */
    .min-h-screen.flex.items-center.justify-center {
        padding: 2rem 1rem !important;
        min-height: calc(100vh - 160px) !important;
        background: #ffffff !important;
    }
    
    /* Login/Register card should stay properly sized */
    .min-h-screen .max-w-md {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
    }
    
    /* 确保登录/注册表单可见 */
    .min-h-screen .rounded-2xl {
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* 登录页面文字颜色 */
    .min-h-screen h2,
    .min-h-screen p,
    .min-h-screen label {
        color: #1f2937 !important;
    }
    
    /* 输入框 */
    .min-h-screen input {
        background: #ffffff !important;
        border: 1px solid #d1d5db !important;
        color: #1f2937 !important;
    }
    
    .min-h-screen input::placeholder {
        color: #9ca3af !important;
    }
}

/* ===== DASHBOARD PAGE FIXES ===== */
@media (max-width: 768px) {
    /* Stats cards */
    .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Booking cards */
    .bg-white.rounded-lg.shadow-lg,
    .rounded-xl.shadow-lg {
        background: #ffffff !important;
        border-radius: 12px !important;
        padding: 1.5rem !important;
        border: 1px solid #e5e7eb !important;
    }
    
    /* 确保Dashboard文字可见 */
    .container h1,
    .container h2,
    .container h3 {
        color: #1f2937 !important;
    }
    
    .container p {
        color: #4b5563 !important;
    }
}

/* ===== THERAPISTS LIST PAGE FIXES ===== */
@media (max-width: 768px) {
    /* Ensure proper spacing */
    .container.mx-auto.px-4.py-8 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* 治疗师卡片网格 */
    #therapists-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* 治疗师卡片优化 */
    .therapist-card {
        background: #ffffff !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        border-radius: 16px !important;
        overflow: hidden;
        margin-bottom: 1rem;
    }
    
    .therapist-card .therapist-info {
        padding: 1rem !important;
    }
    
    /* 筛选器 */
    .filters-mobile {
        background: rgba(255, 255, 255, 0.98) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    }
    
    .filters-mobile h2 {
        color: #1f2937 !important;
    }
}

/* ===== BOOKING PAGE FIXES ===== */
@media (max-width: 768px) {
    /* 预订页面背景 */
    .container.mx-auto.px-4.py-8 {
        background: #ffffff !important;
    }
    
    /* 预订表单 */
    .max-w-4xl {
        max-width: 100% !important;
    }
    
    /* 预订摘要卡片 */
    .lg\:col-span-1 .bg-white {
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
    }
    
    /* 确保预订页面标题和标签可见 */
    .container h1,
    .container h2,
    .container label {
        color: #1f2937 !important;
    }
    
    /* 输入框 */
    .container input,
    .container select,
    .container textarea {
        background: #ffffff !important;
        border: 1px solid #d1d5db !important;
        color: #1f2937 !important;
    }
}

/* ===== THERAPIST DETAIL PAGE FIXES ===== */
@media (max-width: 768px) {
    /* 治疗师详情页面布局 */
    .lg\:col-span-2,
    .lg\:col-span-1 {
        grid-column: span 1 !important;
    }
    
    /* 照片画廊 */
    .grid-cols-4.md\:grid-cols-6 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
}

/* ===== HOME PAGE (INDEX) FIXES ===== */
@media (max-width: 768px) {
    /* TOP 10 治疗师卡片 - 水平滚动优化 */
    .lg\:grid.lg\:grid-cols-5 {
        display: block !important;
    }
    
    .lg\:grid.lg\:grid-cols-5 > .flex {
        display: flex !important;
        gap: 1rem !important;
        overflow-x: auto !important;
        padding: 1rem 0 !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    
    .lg\:grid.lg\:grid-cols-5 > .flex::-webkit-scrollbar {
        display: none !important;
    }
    
    .lg\:grid.lg\:grid-cols-5 .therapist-card {
        flex-shrink: 0 !important;
        width: 160px !important;
        scroll-snap-align: center !important;
    }
    
    /* Entertainment CTA Section - 娱乐导航和附近技师 */
    /* 已移除深色主题覆盖，使用 home-page.css 中定义的浅色主题 */
    
    /* Concept Section */
    .conceptSection {
        background: #ffffff !important;
    }
    
    .concept-item h3,
    .concept-item p {
        color: #1f2937 !important;
    }
    
    /* Flow Section */
    .flowView {
        background: #ffffff !important;
    }
    
    .flowContent h3,
    .flowContent p {
        color: #1f2937 !important;
    }
    
    /* Greeting Section */
    .greetingSection {
        background: #ffffff !important;
    }
    
    .greeting-content p {
        color: #1f2937 !important;
    }
}

/* ===== PROFILE PAGE FIXES ===== */
@media (max-width: 768px) {
    /* 个人资料表单 */
    .container.mx-auto.px-4.py-8 .bg-white {
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
    }
    
    .container h1,
    .container h2,
    .container h3,
    .container label {
        color: #1f2937 !important;
    }
}

/* ===== GENERAL TEXT COLOR FIXES ===== */
/* Ensure text colors are not affected by gradient styles */
h1, h2, h3, h4, h5, h6 {
    -webkit-text-fill-color: initial !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
}

/* ===== FOOTER FIXES FOR MOBILE ===== */
@media (max-width: 768px) {
    /* Footer spacing (handled globally; keep minimal here) */
    footer.priority {
        padding-bottom: 20px !important;
    }
}

/* Desktop: remove extra footer padding */
@media (min-width: 769px) {
    footer.priority {
        padding-bottom: 20px !important;
        margin-bottom: 0 !important;
    }
}

/* ===== MODAL AND POPUP FIXES ===== */
@media (max-width: 768px) {
    /* 筛选器模态框 */
    .filter-modal,
    .modal-mobile {
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
    }
    
    .filter-modal h3,
    .modal-mobile h3 {
        color: #1f2937 !important;
    }
    
    .filter-modal label,
    .modal-mobile label {
        color: #4b5563 !important;
    }
}

/* ===== ALERT AND NOTIFICATION FIXES ===== */
@media (max-width: 768px) {
    /* Success alerts */
    .bg-green-100 {
        background: #d1fae5 !important;
        color: #065f46 !important;
    }
    
    /* Error alerts */
    .bg-red-100 {
        background: #fee2e2 !important;
        color: #991b1b !important;
    }
    
    /* Warning alerts */
    .bg-yellow-100 {
        background: #fef3c7 !important;
        color: #92400e !important;
    }
    
    /* Info alerts */
    .bg-blue-100 {
        background: #dbeafe !important;
        color: #1e40af !important;
    }
}

/* ===== BUTTON COLOR CONSISTENCY ===== */
@media (max-width: 768px) {
    /* 确保按钮文字颜色正确 */
    .btn-gold {
        color: #0a0a0a !important;
    }
    
    .btn-outline-gold {
        color: #d4af37 !important;
    }
    
    /* Pink/主题色按钮 */
    .bg-pink-600 {
        background: #ec4899 !important;
        color: #ffffff !important;
    }
    
    .bg-pink-600:hover {
        background: #db2777 !important;
    }
}

/* ===== LINK COLOR FIXES ===== */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    opacity: 0.8;
}

.text-pink-600 {
    color: #ec4899 !important;
}

.text-blue-600 {
    color: #2563eb !important;
}

/* ===== ENSURE READABLE TEXT ON ALL BACKGROUNDS ===== */
@media (max-width: 768px) {
    /* 白色背景上的文字 */
    .bg-white * {
        color: inherit;
    }
    
    /* 确保所有标题在移动端可见 */
    .container h1,
    .container h2,
    .container h3,
    .container h4,
    .container h5,
    .container h6 {
        color: #1f2937 !important;
    }
    
    /* 确保所有段落在移动端可见 */
    .container p,
    .container span,
    .container div {
        color: inherit;
    }
}

