/* ========================================
   EVEREST HOSPITAL - RESPONSIVE FIXES
   Mobile-First Responsive CSS
   ======================================== */

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

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Responsive container */
.container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ==================== TYPOGRAPHY ==================== */

/* Responsive headings */
h1 {
    font-size: 1.875rem !important; /* 30px */
    line-height: 1.2;
}

@media (min-width: 640px) {
    h1 {
        font-size: 2.25rem !important; /* 36px */
    }
}

@media (min-width: 1024px) {
    h1 {
        font-size: 3rem !important; /* 48px */
    }
}

h2 {
    font-size: 1.5rem !important; /* 24px */
}

@media (min-width: 640px) {
    h2 {
        font-size: 1.875rem !important; /* 30px */
    }
}

@media (min-width: 1024px) {
    h2 {
        font-size: 2.25rem !important; /* 36px */
    }
}

h3 {
    font-size: 1.25rem !important; /* 20px */
}

@media (min-width: 640px) {
    h3 {
        font-size: 1.5rem !important; /* 24px */
    }
}

/* Responsive body text */
p, li, span {
    font-size: 0.875rem; /* 14px */
}

@media (min-width: 640px) {
    p, li, span {
        font-size: 1rem; /* 16px */
    }
}

/* ==================== BUTTONS ==================== */

/* Touch-friendly buttons */
button, .btn, a.btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    button, .btn, a.btn {
        font-size: 1rem;
    }
}

/* ==================== CARDS & GRIDS ==================== */

/* Responsive card grids */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* ==================== IMAGES ==================== */

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* ==================== TABLES ==================== */

/* Responsive tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    min-width: 600px;
}

@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem !important;
    }
}

/* ==================== FORMS ==================== */

/* Responsive form inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
    padding: 0.75rem;
}

/* Form groups stack on mobile */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
    }
    
    .form-row > * {
        flex: 1;
    }
}

/* ==================== SECTIONS ==================== */

/* Responsive section padding */
section {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 640px) {
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

@media (min-width: 1024px) {
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* ==================== DOCTOR CARDS ==================== */

.doctor-card {
    width: 100%;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .doctor-card {
        width: calc(50% - 1rem);
    }
}

@media (min-width: 1024px) {
    .doctor-card {
        width: calc(33.333% - 1rem);
    }
}

/* ==================== DEPARTMENT CARDS ==================== */

.department-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .department-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .department-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* ==================== PACKAGE CARDS ==================== */

.package-card {
    width: 100%;
}

@media (min-width: 768px) {
    .package-card {
        width: calc(50% - 1rem);
    }
}

@media (min-width: 1024px) {
    .package-card {
        width: calc(33.333% - 1rem);
    }
}

/* ==================== TESTIMONIALS ==================== */

.testimonial-card {
    width: 100%;
}

@media (min-width: 640px) {
    .testimonial-card {
        width: calc(50% - 1rem);
    }
}

@media (min-width: 1024px) {
    .testimonial-card {
        width: calc(33.333% - 1.5rem);
    }
}

/* ==================== MODAL & POPUPS ==================== */

.modal {
    width: 95%;
    max-width: 600px;
    margin: 1rem auto;
}

@media (min-width: 768px) {
    .modal {
        width: 90%;
        margin: 2rem auto;
    }
}

/* ==================== SIDEBAR & DASHBOARD ==================== */

.sidebar {
    width: 100%;
    position: relative;
}

@media (min-width: 1024px) {
    .sidebar {
        width: 250px;
        position: sticky;
        top: 1rem;
    }
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== GALLERY ==================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* ==================== NEWS & EVENTS ==================== */

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== APPOINTMENT BOOKING ==================== */

.appointment-form {
    max-width: 100%;
}

@media (min-width: 768px) {
    .appointment-form {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ==================== CONTACT PAGE ==================== */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==================== HERO SECTION ==================== */

.hero-section {
    min-height: 50vh;
    padding: 2rem 1rem;
}

@media (min-width: 640px) {
    .hero-section {
        min-height: 60vh;
        padding: 3rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-section {
        min-height: 70vh;
        padding: 4rem 2rem;
    }
}

/* ==================== BREADCRUMBS ==================== */

.breadcrumb {
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .breadcrumb {
        font-size: 0.875rem;
    }
}

/* ==================== PAGINATION ==================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.pagination a,
.pagination span {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== HIDE/SHOW UTILITIES ==================== */

/* Hide on mobile */
@media (max-width: 639px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 640px) and (max-width: 1023px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show on mobile only */
.show-mobile {
    display: block;
}

@media (min-width: 640px) {
    .show-mobile {
        display: none;
    }
}

/* Show on desktop only */
.show-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .show-desktop {
        display: block;
    }
}

/* ==================== SPACING UTILITIES ==================== */

.section-padding {
    padding: 2rem 1rem;
}

@media (min-width: 640px) {
    .section-padding {
        padding: 3rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .section-padding {
        padding: 4rem 2rem;
    }
}

/* ==================== TEXT ALIGNMENT ==================== */

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

@media (min-width: 768px) {
    .text-center-mobile {
        text-align: left;
    }
}

/* ==================== FLEXBOX UTILITIES ==================== */

.flex-col-mobile {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .flex-col-mobile {
        flex-direction: row;
    }
}

/* ==================== VIDEO EMBEDS ==================== */

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ==================== PRINT STYLES ==================== */

@media print {
    nav,
    footer,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ==================== ACCESSIBILITY ==================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #0066B2;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0066B2;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ==================== PERFORMANCE ==================== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
