/* =================================
   ORTHOPEDIC DOCTOR WEBSITE STYLES
   Custom CSS for Enhanced Responsiveness
   ================================= */

/* Base Responsive Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal scroll on mobile */
body, html {
    max-width: 100vw;
}

/* Images Responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Mobile Menu Enhancements */
@media (max-width: 768px) {
    /* Better touch targets for mobile */
    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improved spacing on mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Better text readability on mobile */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
}

/* Tablet Optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Navigation Dropdown Responsiveness */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    nav .relative.group {
        position: static;
    }
    
    nav .absolute {
        position: relative;
        opacity: 1 !important;
        visibility: visible !important;
        display: none;
    }
    
    nav .relative.group:hover .absolute {
        display: block;
    }
}

/* Form Elements Mobile Enhancement */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

/* Card Grid Responsiveness */
@media (max-width: 640px) {
    .grid {
        gap: 1rem;
    }
}

/* Footer Services Grid Mobile */
@media (max-width: 768px) {
    footer .footer-services {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    footer .footer-services ul {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Mobile Table Responsiveness */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Floating Buttons Mobile Position */
@media (max-width: 640px) {
    .fixed.bottom-6.right-6 {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }
    
    .fixed.bottom-24.right-6 {
        bottom: 5rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }
}

/* Hero Section Mobile Enhancement */
@media (max-width: 768px) {
    section.bg-gradient-to-r {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Service Card Hover Effects */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

@media (max-width: 768px) {
    .service-card:hover {
        transform: none; /* Disable hover effects on mobile */
    }
}

/* Testimonial Slider Mobile */
@media (max-width: 768px) {
    .testimonial-card {
        min-width: 280px;
    }
}

/* Map Responsive */
iframe {
    max-width: 100%;
}

/* Gallery Grid Mobile */
@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ Accordion Mobile */
/* FAQ Accordion Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
}

.faq-answer {
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.hidden {
    display: none;
    opacity: 0;
    max-height: 0;
}

.faq-answer:not(.hidden) {
    display: block;
    animation: slideDown 0.4s ease-out forwards;
}

.faq-answer.closing {
    animation: slideUp 0.3s ease-in forwards;
}

.faq-question {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.faq-question i {
    transition: transform 0.3s ease;
}

/* Service page FAQ (h4.cursor-pointer pattern) */
h4.cursor-pointer + div {
    overflow: hidden;
    transition: all 0.3s ease;
}

h4.cursor-pointer + div.hidden {
    display: none;
    opacity: 0;
    max-height: 0;
}

h4.cursor-pointer + div:not(.hidden) {
    display: block;
    animation: slideDown 0.4s ease-out forwards;
}

h4.cursor-pointer + div.closing {
    animation: slideUp 0.3s ease-in forwards;
}

@media (max-width: 768px) {
    .faq-question {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .faq-answer {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Appointment Form Mobile */
@media (max-width: 768px) {
    .appointment-form {
        padding: 1.5rem;
    }
    
    .appointment-form .grid {
        grid-template-columns: 1fr;
    }
}

/* About Doctor Section Mobile */
@media (max-width: 1024px) {
    .about-doctor-grid {
        grid-template-columns: 1fr;
    }
}

/* Statistics Counter Mobile */
@media (max-width: 640px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* WhatsApp Button Animation */
.wa-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Loading Animation */
.loading {
    animation: spin 1s linear infinite;
}

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

/* Smooth Transitions */
a, button, .transition-all {
    transition: all 0.3s ease;
}

/* Focus States for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #f97425;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header, footer, nav, .fixed {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
}

/* High DPI / Retina Display Optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Landscape Mode Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-section {
        min-height: 60vh;
    }
}

/* Safe Area for Notched Devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Performance Optimization */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #00447c;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f97425;
}

/* Mobile Navigation Fix */
@media (max-width: 768px) {
    .mobile-menu-open {
        overflow: hidden;
    }
}

/* Ensure content fits viewport */
section {
    overflow-x: hidden;
}

/* Better line breaks on mobile */
@media (max-width: 640px) {
    .break-words {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* Enhanced Touch Feedback */
@media (hover: none) and (pointer: coarse) {
    button:active,
    a:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* =================================
   FOOTER ANIMATIONS
   ================================= */

/* Background parallax effect */
@keyframes footerBgFloat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.footer-bg-animate {
    animation: footerBgFloat 20s ease-in-out infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Slide from left animation */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.footer-slide-left {
    animation: slideLeft 0.5s ease-out forwards;
    opacity: 0;
}

/* Map zoom in animation */
@keyframes mapZoom {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.footer-map-zoom {
    animation: mapZoom 0.8s ease-out forwards;
    opacity: 0;
    animation-delay: 0.6s;
}

/* Pulse animation for social icons */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

footer a[href*="facebook"],
footer a[href*="instagram"],
footer a[href*="youtube"] {
    animation: pulse 2s infinite;
}

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {
    .footer-bg-animate {
        animation: none;
    }
    
    footer a[href*="facebook"],
    footer a[href*="instagram"],
    footer a[href*="youtube"] {
        animation: none;
    }
}

/* Smooth transitions for all footer links */
footer a {
    transition: all 0.3s ease;
}

