* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: 70px;
}

.container {
    margin: auto;
    padding: 20px 0;
    text-align: center;
}

/* ========== CONSISTENT HEADER STYLES ========== */
header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 8px 5%;
    background-color: #ecf5ff;
    width: 100%;
    max-width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    gap: 15px;
    box-sizing: border-box;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-circle {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-circle img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.clinic-info h1 {
    font-size: clamp(12px, 3vw, 15px);
    text-align: left;
    color: #333;
    margin: 0 0 5px 0;
}

.clinic-info p {
    font-size: clamp(8px, 2.5vw, 10px);
    color: #555;
    margin: 0;
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: #0066cc;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: rgba(0, 102, 204, 0.1);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(5px, 4vw, 25px);
    flex: 1;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    font-size: clamp(10px, 3vw, 12px);
    transition: color 0.3s;
    white-space: nowrap;
}

.main-nav a:hover {
    color: #0066cc;
}

.main-nav a.active {
    color: #0056b3;
    font-weight: bold;
}

.header-right {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex-shrink: 1;
}

.profile-icon i {
    color: royalblue;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.auth-link {
    text-decoration: none;
    color: #0066cc;
    font-weight: 600;
    font-size: clamp(10px, 3vw, 12px);
    white-space: nowrap;
}

.welcome-text {
    font-weight: 700;
    font-size: clamp(10px, 3vw, 12px);
    color: #003366;
    white-space: nowrap;
}

/* ========== MOBILE-ONLY RESTRUCTURING ========== */
/* This ONLY applies to screens 768px and below */

@media (max-width: 768px) {
    body {
        padding-top: 95px;
    }
    
    /* Change header to grid layout for reordering */
    header {
        display: grid;
        grid-template-areas: 
            "logo hamburger"
            "user user"
            "nav nav";
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
    }
    
    /* Assign grid areas */
    .logo-container {
        grid-area: logo;
    }
    
    .mobile-menu-btn {
        grid-area: hamburger;
        display: block;
        justify-self: end;
        padding: 6px 8px;
    }
    
    .header-right {
        grid-area: user;
        justify-content: flex-end;
        width: 100%;
        padding-top: 5px;
        border-top: 1px solid rgba(0, 102, 204, 0.1);
        margin-top: 0;
    }
    
    /* FIXED: Horizontal navigation - SIDE BY SIDE (NO absolute positioning) */
    .main-nav {
        grid-area: nav;
        display: none;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100%;
        padding: 10px 12px !important;
        background: #ecf5ff;
        border-top: 1px solid #d0e0f0;
        border-bottom: 1px solid #d0e0f0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        margin-top: 0;
    }
    
    .main-nav.show {
        display: flex !important;
    }
    
    .main-nav a {
        white-space: nowrap;
        padding: 6px 0 !important;
        width: auto !important;
        text-align: center;
        font-size: 13px;
        border-bottom: none !important;
        background: none;
    }
    
    .main-nav a:last-child {
        border-bottom: none;
    }
    
    /* Adjust logo sizes for mobile */
    .logo-circle {
        width: 32px;
        height: 32px;
    }
    
    .logo-circle img {
        width: 36px;
        height: 36px;
    }
    
    .clinic-info h1 {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .clinic-info p {
        font-size: 7px;
    }
    
    /* Header right spacing */
    .header-right {
        gap: 8px;
    }
    
    .profile-icon i {
        font-size: 14px;
    }
    
    .welcome-text {
        font-size: 10px;
        white-space: nowrap;
    }
    
    .welcome-text .auth-link,
    .header-right .auth-link {
        font-size: 10px;
        white-space: nowrap;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
    
    header {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .logo-circle {
        width: 28px;
        height: 28px;
    }
    
    .logo-circle img {
        width: 32px;
        height: 32px;
    }
    
    .clinic-info h1 {
        font-size: 9px;
    }
    
    .clinic-info p {
        font-size: 6px;
    }
    
    .mobile-menu-btn {
        padding: 5px 8px;
        font-size: 16px;
    }
    
    .header-right {
        gap: 6px;
    }
    
    .profile-icon i {
        font-size: 12px;
    }
    
    .welcome-text {
        font-size: 9px;
        white-space: nowrap;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .welcome-text .auth-link,
    .header-right .auth-link {
        font-size: 9px;
    }
    
    /* On very small screens, nav links may wrap */
    .main-nav {
        gap: 10px !important;
        padding: 8px 10px !important;
    }
    
    .main-nav a {
        font-size: 12px;
    }
}

/* CUSTOM TIME in appointment form */
#custom_time_input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

/* Style both selects consistently */
#preferred_time, #custom_time_input {
    background-color: white;
    color: #333;
}

/* Hero */
.hero {
    background-color: #155a7c;
    padding: 50px 20px;
    margin-top: 40px;
}

.hero h2 {
    font-size: 36px;
    color: white;
}

.hero p {
    margin-top: 10px;
    font-size: 16px;
    color: white;
}

/* About Section */
.about-section {
    background-color: white;
    padding: 60px 0;
}

.content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
}

.text-column {
    color: #004c99;
    margin-bottom: 0px;
    flex: 1 1 100%;
    text-align: center;
}

.image-column {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
}

.image-column img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 10px;
}

.text-column h1 {
    color: #004c99;
    margin-bottom: 20px;
    margin-top: 30px;
    font-size: 22px;
    margin-left: 5rem;
}

.text-column p {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 2.2;
}

.book-btn:hover {
    background-color: #003366;
}

/* Partnership Section */
.partnership-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
}

.partner-box {
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    width: 250px;
    text-align: center;
    transition: 0.3s ease;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.partner-section img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.partner-section h4 {
    margin-top: 10px;
    font-size: 18px;
    color: #004c99;
    margin-left: 3rem;
}

.partner-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Team Section */
.team-section {
    background-color: #f0f8ff;
    padding: 60px 0;
    width: 110%;
    margin-left: -10%;
    margin-top: 100px;
}

.team-section h2 {
    color: #004c99;
    font-size: 32px;
    margin-bottom: 10px;
    margin-left: 150px;
}

.team-section p {
    font-size: 16px;
    margin-bottom: 40px;
    color: #555;
}

.team-section .team-intro {
    margin-left: 150px;
    margin-bottom: 80px;
    font-style: italic;
}

.clinic-description {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 25px;
    margin-left: 5rem;
    margin-right: 3rem;
    text-align: left;
    color: #6b7280;
}

.team-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 60px;
    justify-content: center;
    margin-left: 100px;
}

.team-member {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 20px;
    width: 220px;
    text-align: center;
    margin-left: 50px;
    transition: transform 0.3s ease;
}

.team-member img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.team-member h4 {
    font-size: 18px;
    color: #004c99;
    margin-bottom: 5px;
}

.team-member p {
    font-size: 14px;
    color: #666;
}

.team-member:hover {
    transform: translateY(-5px);
}

/* Footer */
.footer {
    background-color: #1d6d96;
    color: white;
    padding: 2rem 1rem;
    font-family: Arial, sans-serif;
}

.footer-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 100%;
    margin: auto;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Left section */
.footer-left {
    flex: 1;
    min-width: 750px;
}

.clinic-branding {
    display: flex;
    align-items: center;
    margin-bottom: 6rem;
}

.footer-logo {
    width: 80px;
    height: 50px;
    margin-right: 1rem;
}

.clinic-branding h2 {
    margin: 0;
    font-size: 1.5rem;
    text-align: left;
    color: antiquewhite;
}

.clinic-branding p {
    margin: 0.3rem 0 0;
    font-size: 0.95rem;
    color: #e5f1f7;
}

.footer-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.2rem;
}

.footer-row .contact-label {
    margin-right: 100%;
}

.footer-row .contact-label a {
    color: #d0e9ff;
}

.icon {
    width: 30px;
    height: 30px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.contact-label {
    font-weight: bold;
    margin: 0;
}

.footer-right {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 5px;
}

.contact-info {
    text-align: left;
}

.contact-info a {
    color: #d0e9ff;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .content,
    .team-grid {
        flex-direction: column;
    }

    /* REMOVED the logo-container flex-direction: column that was causing the issue */
    /* The logo-container should maintain its horizontal layout */
    
    .main-nav {
        margin-top: 10px;
    }

    .header-right {
        margin-top: 0px;
    }
}
/* Certifications Section - Fixed Alignment */
.certifications {
    padding: 60px 0 40px;
    text-align: center;
    width: 100%;
}

.certifications h2 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    margin-top: 50px;
    color: #004c99;
}

.certifications p.cert-desc {
    color: #555;
    margin: 0 auto 50px;
    max-width: 700px;
    padding: 0 20px;
    font-size: 16px;
    line-height: 1.6;
}

.cert-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    margin-top: 30px;
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.cert-card {
    background: #f9fbff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 25px 20px;
    width: 220px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 350px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: #333;
    border: 1px solid #e8f1f8;
}

.cert-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.cert-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #1d6d96;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-card h4 {
    font-size: 16px;
    color: #004c99;
    margin: 0 0 12px 0;
    line-height: 1.4;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.cert-card p {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 15px 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.cert-card span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1d6d96;
    font-weight: 600;
    font-size: 14px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e0e7ff;
    width: 100%;
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cert-grid {
        gap: 20px;
        padding: 0 15px;
    }
    
    .cert-card {
        width: 100%;
        max-width: 300px;
        min-height: 250px;
    }
    
    .cert-card h4 {
        min-height: 40px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .certifications {
        padding: 40px 0;
    }
    
    .cert-grid {
        gap: 15px;
    }
    
    .certifications h2 {
        margin-top: 30px;
        font-size: 1.8rem;
    }
    
    .certifications p.cert-desc {
        margin-bottom: 30px;
        padding: 0 15px;
    }
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 80%;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
}

.close {
    position: absolute;
    top: 30px;
    right: 45px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #ff6b6b;
    text-decoration: none;
}

.text-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
    padding: 0 15px;
}

.text-column > h1,
.text-column > p {
    text-align: left;
    margin-bottom: 70px;
}

/* Partnership Section Update */
.partnership-section {
    background-color: #fff;
    padding: 40px 20px;
    margin-bottom: 80px;
    margin-top: 50px;
}

.partnership-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 150px;
    align-items: center;
    justify-content: center;
    text-align: left;
}

.orthero-image img {
    max-width: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.orthero-description {
    max-width: 600px;
    color: #333;
}

.orthero-description h4 {
    font-size: 24px;
    color: #004c99;
    margin-bottom: 10px;
}

.orthero-description p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
}

@media (max-width: 768px) {
    .partnership-flex {
        flex-direction: column;
        text-align: center;
    }

    .orthero-description {
        text-align: center;
    }
}

.text-column h1 {
    color: #004c99;
    margin-bottom: 20px;
    margin-top: 30px;
    font-size: 22px;
}

@media (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
    .team-section {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 40px 20px !important;
        box-sizing: border-box !important;
    }
    
    .team-section h2,
    .team-section .team-intro {
        margin-left: 0 !important;
        text-align: center !important;
    }
    
    .team-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 40px !important;
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .team-member {
        flex: 0 0 auto !important;
        width: 200px !important;
        margin-left: 0 !important;
    }
    
    .team-member img {
        width: 100% !important;
        height: 200px !important;
        object-fit: cover !important;
    }
}

/* Remove all top margins from the main content area */
.hero,
.about-section,
.team-section,
.certifications,
.partnership-section {
    margin-top: 0;
}

/* Ensure the first element after header has no top margin */
body > section:first-of-type,
body > div:first-of-type {
    margin-top: 0;
    padding-top: 0;
}