* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CRITICAL: Prevent horizontal scroll on body and html */
html, body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    overflow-x: hidden; /* This prevents horizontal scrollbars */
    max-width: 100vw; /* Ensure no content exceeds viewport width */
}

/* Overlay Banner Styles - FIXED VERSION */
.medview-overlay {
    position: fixed; /* Keep fixed positioning */
    top: 0;
    left: 0;
    width: 100vw; /* Changed from 100% to 100vw for viewport width */
    height: 100vh; /* Changed from 100% to 100vh for viewport height */
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    /* REMOVED: background-attachment: fixed; - causes issues on mobile and can cause overflow */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 1s ease-in;
    overflow: hidden; /* Prevent any internal overflow */
    padding: 20px; /* Add safe padding for mobile */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Close Button - IMPROVED */
.close-overlay {
    position: absolute;
    top: 20px; /* Reduced from 30px for better mobile spacing */
    right: 20px; /* Reduced from 40px for better mobile spacing */
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10000; /* Ensure it's above content */
}

.close-overlay:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: rotate(90deg);
}

/* Content Container - FIXED */
.overlay-content {
    text-align: center;
    color: white;
    max-width: 800px; /* Keep max-width */
    width: 100%; /* Full width within max-width */
    padding: 60px 40px;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    animation: slideUp 1s ease-out 0.3s both;
    margin: 0 auto; /* Center the content */
    /* Ensure content doesn't exceed viewport */
    max-height: calc(100vh - 40px); /* Account for padding */
    overflow-y: auto; /* Allow vertical scroll if needed */
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Logo/Brand */
.overlay-brand {
    font-size: clamp(18px, 4vw, 24px); /* Responsive font size */
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #fff;
    text-transform: uppercase;
}

/* Coming Soon Text - RESPONSIVE */
.coming-soon-text {
    font-size: clamp(36px, 8vw, 72px); /* Responsive font size to prevent overflow */
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: -2px;
    word-break: break-word; /* Prevent text overflow on small screens */
    hyphens: auto; /* Allow hyphenation if needed */
}

.subtitle {
    font-size: clamp(16px, 3vw, 20px); /* Responsive font size */
    font-weight: 300;
    margin-bottom: 15px;
    opacity: 0.9;
    line-height: 1.6;
}

.description {
    font-size: clamp(14px, 2.5vw, 16px); /* Responsive font size */
    line-height: 1.8;
    margin-bottom: 40px;
    opacity: 0.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA Buttons - IMPROVED */
.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
    width: 100%; /* Ensure full width usage */
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 18px 35px;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 50px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    min-width: 180px; /* Minimum width for consistency */
    justify-content: center;
    white-space: nowrap; /* Prevent text wrapping */
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-btn:hover::before {
    left: 100%;
}

.cta-btn.primary {
    background: #fff;
    color: #000;
}

.cta-btn.primary:hover {
    background: transparent;
    color: #fff;
    box-shadow: 0 0 30px rgba(255,255,255,0.3);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,255,255,0.2);
}

.cta-btn svg {
    margin-left: 10px;
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.cta-btn:hover svg {
    transform: translateX(5px);
}

/* Responsive Design - IMPROVED */
@media (max-width: 768px) {
    .medview-overlay {
        padding: 15px; /* Reduce padding on mobile */
    }

    .overlay-content {
        padding: 40px 20px;
        margin: 0; /* Remove margin on mobile */
        border-radius: 15px;
        max-height: calc(100vh - 30px); /* Adjust for reduced padding */
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .cta-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        min-width: auto; /* Remove min-width on mobile */
        padding: 16px 30px; /* Slightly smaller padding */
    }

    .close-overlay {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .medview-overlay {
        padding: 10px; /* Further reduce padding */
    }

    .overlay-content {
        padding: 30px 15px;
        border-radius: 10px;
    }

    .description {
        margin-bottom: 30px;
    }

    .cta-buttons {
        margin-top: 30px;
        gap: 12px;
    }

    .cta-btn {
        padding: 14px 25px;
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .close-overlay {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .overlay-content {
        padding: 20px 10px;
    }

    .cta-btn {
        padding: 12px 20px;
        font-size: 13px;
        min-width: auto;
    }

    .close-overlay {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Fade out animation */
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Additional utility classes to prevent overflow issues */
.no-scroll {
    overflow: hidden;
}

/* High DPI / Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .overlay-content {
        backdrop-filter: blur(20px);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .medview-overlay,
    .overlay-content,
    .cta-btn,
    .close-overlay {
        animation: none;
        transition: none;
    }
    
    .close-overlay:hover {
        transform: none;
    }
    
    .cta-btn:hover {
        transform: none;
    }
}

/* Focus states for accessibility */
.close-overlay:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.cta-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .medview-overlay {
        display: none !important;
    }
}