/* 
 * Medical Concierge Website Enhancements
 * Based on website-ux-design skill best practices
 * 
 * Enhancements:
 * - Improved visual hierarchy
 * - Better trust signals
 * - Enhanced mobile experience
 * - Smoother animations
 * - Conversion optimization
 */

/* === 1. Enhanced Hero Section - 紫色主题 === */

/* Animated gradient background - 紫色系 */
.hero {
    background: linear-gradient(-45deg, #7B61C1, #9D8AD6, #6B52B1, #7B61C1);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles effect */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: floatParticles 20s linear infinite;
    pointer-events: none;
}

@keyframes floatParticles {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-50px) rotate(360deg); }
}

/* Enhanced CTA buttons with pulse - 紫色光晕 */
.hero .btn-primary {
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(123, 97, 193, 0.7);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(123, 97, 193, 0);
        transform: scale(1.02);
    }
}

/* Button shine effect */
.hero .btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* === 2. Improved Trust Signals === */

/* Trust badges with icons */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem auto;
    max-width: 800px;
}

.trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease backwards;
}

.trust-badge:nth-child(1) { animation-delay: 0.1s; }
.trust-badge:nth-child(2) { animation-delay: 0.2s; }
.trust-badge:nth-child(3) { animation-delay: 0.3s; }
.trust-badge:nth-child(4) { animation-delay: 0.4s; }

.trust-badge:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* === 3. Enhanced Service Cards === */

.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #7B61C1, #4ECDC4);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(123, 97, 193, 0.2);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* === 4. Pricing Cards Enhancement === */

.pricing-card {
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card.featured {
    transform: scale(1.05);
    border: 2px solid var(--primary-color);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.pricing-card::after {
    content: '⭐ MOST POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #7B61C1, #9D8AD6);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
}

/* === 5. Testimonials Enhancement === */

.testimonial-card {
    position: relative;
    padding: 2rem;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 6rem;
    color: #7B61C1;
    opacity: 0.15;
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Star rating animation */
.testimonial-stars {
    color: #fbbf24;
    animation: starGlow 2s infinite;
}

@keyframes starGlow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.5)); }
    50% { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8)); }
}

/* === 6. FAQ Accordion Enhancement === */

.faq-item {
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.faq-question {
    position: relative;
    padding-right: 3rem;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    transition: max-height 0.4s cubic-bezier(1, 0, 1, 0);
}

/* === 7. Contact Form Enhancement === */

.contact-form input,
.contact-form textarea,
.contact-form select {
    position: relative;
    transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.contact-form button[type="submit"] {
    position: relative;
    overflow: hidden;
}

.contact-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* === 8. WhatsApp Float Enhancement === */

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    animation: whatsappBounce 2s infinite;
}

@keyframes whatsappBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.whatsapp-float:hover {
    animation: none;
    transform: scale(1.1);
}

/* === 9. Scroll Animations === */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === 10. Loading States === */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === 11. Mobile Optimizations === */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .trust-badges {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-card.featured {
        transform: scale(1);
    }
    
    .pricing-card.featured:hover {
        transform: translateY(-5px);
    }
}

/* === 12. Accessibility Improvements === */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* === 13. Hospital Fees Table Enhancement === */

.hospital-fees {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.fee-table-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.fee-table {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.fee-table:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.15);
}

.fee-table-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
}

.fee-table-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.hospital-fullname {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.fee-table-content {
    width: 100%;
    border-collapse: collapse;
}

.fee-table-content thead {
    background: #f8f9fa;
}

.fee-table-content th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
}

.fee-table-content td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
}

.fee-table-content tbody tr {
    transition: background 0.2s ease;
}

.fee-table-content tbody tr:hover {
    background: #f8f9fa;
}

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

.fee-note {
    padding: 1rem;
    background: #fff3cd;
    border-top: 1px solid #ffc107;
    font-size: 0.85rem;
    color: #856404;
    margin: 0;
}

.fees-comparison-note {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.fees-comparison-note h3 {
    margin: 0 0 1.5rem 0;
    color: var(--primary-color);
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.comparison-card {
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    background: #f8f9fa;
}

.comparison-card h4 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.comparison-card p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.comparison-tip {
    margin-top: 1rem !important;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem !important;
}

.comparison-card:nth-child(1) {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.comparison-card:nth-child(2) {
    border-left-color: #667eea;
    background: #f0f4ff;
}

.comparison-card:nth-child(3) {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.disclaimer {
    padding: 1rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    margin: 1.5rem 0 1rem 0;
    font-size: 0.9rem;
    color: #92400e;
}

.service-value {
    padding: 1rem;
    background: #d1fae5;
    border-left: 4px solid #10b981;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #065f46;
    margin: 0;
}

/* Responsive for fee tables */
@media (max-width: 768px) {
    .fee-table-container {
        grid-template-columns: 1fr;
    }
    
    .fee-table-content {
        font-size: 0.85rem;
    }
    
    .fee-table-content th,
    .fee-table-content td {
        padding: 0.5rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* === 14. Print Styles === */

@media print {
    .hero,
    .nav,
    .whatsapp-float,
    .btn-contact {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}
