/* Mobile Touch Optimization */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

button, .cursor-pointer {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
    cursor: pointer;
}

/* Ensure buttons are properly sized for mobile */
button {
    min-height: 44px;
    min-width: 44px;
}

/* Fix for mobile modal interactions */
.modal-button {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;
    -webkit-appearance: none;
    touch-action: manipulation;
    user-select: none;
}

/* Fix potential z-index issues on mobile */
.modal-overlay {
    z-index: 9999;
    -webkit-overflow-scrolling: touch;
}

/* Ensure proper scrolling on mobile modals */
.modal-content {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Image Lightbox Styles */
.lightbox-overlay {
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.lightbox-content {
    animation: lightboxZoom 0.3s ease;
}

.lightbox-close {
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.lightbox-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Clickable image indicators */
.hotel-lightbox-image, .testimonial-lightbox-image, .team-lightbox-image, .clickable-image {
    transition: all 0.2s ease;
    position: relative;
}

.hotel-lightbox-image::after, .testimonial-lightbox-image::after, .team-lightbox-image::after, .clickable-image::after {
    content: '🔍';
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 6px;
    border-radius: 50%;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.hotel-lightbox-image:hover::after, .testimonial-lightbox-image:hover::after, .team-lightbox-image:hover::after, .clickable-image:hover::after {
    opacity: 1;
}

/* Mobile lightbox optimizations */
@media (max-width: 768px) {
    .lightbox-content {
        padding: 1rem;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Always show magnify icon on mobile */
    .hotel-lightbox-image::after, .testimonial-lightbox-image::after, .team-lightbox-image::after, .clickable-image::after {
        opacity: 0.8;
    }
    
    /* Ensure images are properly sized on mobile */
    #lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
        width: auto;
        height: auto;
    }
}

/* Navigation Styles */
#navigation {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#navigation.scrolled {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-link {
    color: #374151;
    transition: color 0.2s ease;
}

#navigation.scrolled .nav-link {
    color: #374151;
}

.nav-link:hover {
    color: #fbbf24;
}

#navigation.scrolled .nav-link:hover {
    color: #2563eb;
}

.mobile-menu-btn {
    color: #374151;
    transition: color 0.2s ease;
}

#navigation.scrolled .mobile-menu-btn {
    color: #374151;
}

.mobile-menu-btn:hover {
    color: #fbbf24;
}

#navigation.scrolled .mobile-menu-btn:hover {
    color: #2563eb;
}

.mobile-menu {
    max-height: 0;
    transition: max-height 0.3s ease;
}

.mobile-menu.open {
    max-height: 300px;
}

.logo-container {
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: scale(1.05);
}

/* Hero Section Animations */
.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-title {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.scroll-indicator {
    animation: fadeInUp 0.8s ease-out 1s both;
}

/* Section Animations */
.section-header {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

.section-header.in-view {
    opacity: 1;
    transform: translateY(0);
}

.travel-image {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.8s ease 0.2s;
}

.travel-image.in-view {
    opacity: 1;
    transform: translateX(0);
}

/* Testimonial Styles */
.testimonial-card {
    transition: all 0.5s ease;
}

.testimonial-card.fade-out {
    opacity: 0;
    transform: translateY(20px);
}

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

/* Back to Top Button */
#back-to-top {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    transform: scale(1);
}

#back-to-top:hover {
    transform: scale(1.1);
}

/* EXACT WORKING MODAL SYSTEM */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.modal.show {
    display: block;
}

.modal .modal-content {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .modal .modal-content {
        top: 10px;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
}

.modal .modal-content {
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* Enhanced Modal Styles for All Modals */
.modal,
/* Modal content styling */
.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin: 0 auto;
    align-self: flex-start; /* Ensure content starts from top */
}

.modal.hidden,
#bill-reduction-modal.hidden,
#prescription-modal.hidden,
#travel-modal.hidden,
#benefits-modal.hidden {
    display: none !important;
}

.modal.show,
/* Mobile Modal Optimization */
@media (max-width: 768px) {
    .modal-content {
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        border-radius: 8px;
        margin-top: 0; /* No top margin on mobile */
    }
}

.modal > div,
#bill-reduction-modal > div,
#prescription-modal > div,
#travel-modal > div,
#benefits-modal > div {
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show > div,
#bill-reduction-modal.show > div,
#prescription-modal.show > div,
#travel-modal.show > div,
#benefits-modal.show > div {
    transform: scale(1) translateY(0);
}

/* Modal Video Styling */
.modal video {
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Modal Button Styling */
.modal button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* EMERGENCY MOBILE MODAL FIX - Critical Mobile Optimization */
@media (max-width: 768px) {
    /* Modal Container Sizing - CRITICAL FIX */
    .modal,
    #bill-reduction-modal,
    #prescription-modal,
    #travel-modal,
    #benefits-modal {
        padding: 0.5rem !important; /* Minimal padding on mobile */
    }
    
    /* Modal Content Box - AGGRESSIVE SIZING */
    .modal > div,
    #bill-reduction-modal > div,
    #prescription-modal > div,
    #travel-modal > div,
    #benefits-modal > div {
        width: calc(100vw - 1rem) !important; /* Almost full width with small margin */
        max-width: none !important; /* Remove max-width restrictions */
        height: calc(100vh - 2rem) !important; /* Almost full height with small margin */
        max-height: calc(100vh - 2rem) !important; /* Critical height fix */
        margin: 0.5rem auto !important; /* Minimal margins */
        overflow-y: auto !important; /* Enable scrolling */
        display: flex !important;
        flex-direction: column !important;
        border-radius: 0.75rem !important; /* Smaller border radius */
    }
    
    /* Modal Header - Fixed Header */
    .modal .bg-nexus-gradient,
    #bill-reduction-modal .bg-nexus-gradient,
    #prescription-modal .bg-nexus-gradient,
    #travel-modal .bg-nexus-gradient,
    #benefits-modal .bg-nexus-gradient {
        flex-shrink: 0 !important; /* Header stays fixed */
        padding: 1rem !important; /* Reduced header padding */
    }
    
    /* Modal Body - Scrollable Content */
    .modal .p-8,
    .modal .p-6,
    #bill-reduction-modal .p-8,
    #bill-reduction-modal .p-6,
    #prescription-modal .p-8,
    #prescription-modal .p-6,
    #travel-modal .p-8,
    #travel-modal .p-6,
    #benefits-modal .p-8,
    #benefits-modal .p-6 {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 1rem !important; /* Reduced body padding */
        overflow-x: hidden !important; /* Prevent horizontal scroll */
    }
    
    /* Text Scaling - AGGRESSIVE REDUCTION */
    .modal h2,
    #bill-reduction-modal h2,
    #prescription-modal h2,
    #travel-modal h2,
    #benefits-modal h2 {
        font-size: 1.25rem !important; /* Smaller modal titles */
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .modal h3,
    #bill-reduction-modal h3,
    #prescription-modal h3,
    #travel-modal h3,
    #benefits-modal h3 {
        font-size: 1.125rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .modal h4,
    #bill-reduction-modal h4,
    #prescription-modal h4,
    #travel-modal h4,
    #benefits-modal h4 {
        font-size: 0.875rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .modal p,
    #bill-reduction-modal p,
    #prescription-modal p,
    #travel-modal p,
    #benefits-modal p {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .modal .text-sm,
    #bill-reduction-modal .text-sm,
    #prescription-modal .text-sm,
    #travel-modal .text-sm,
    #benefits-modal .text-sm {
        font-size: 0.75rem !important;
    }
    
    /* Image Scaling - MUCH SMALLER */
    .modal img,
    #bill-reduction-modal img,
    #prescription-modal img,
    #travel-modal img,
    #benefits-modal img {
        max-height: 120px !important; /* Much smaller images */
        width: 100% !important;
        object-fit: cover !important;
        border-radius: 0.5rem !important;
    }
    
    /* Video Scaling - SMALLER HEIGHT */
    .modal video,
    #bill-reduction-modal video,
    #prescription-modal video {
        max-height: 180px !important; /* Smaller video height */
        width: 100% !important;
        border-radius: 0.5rem !important;
    }
    
    /* Grid Fixes - FORCE SINGLE COLUMN */
    .modal .grid,
    .modal .grid-cols-1,
    .modal .grid-cols-2,
    .modal .grid-cols-3,
    .modal .md\\:grid-cols-2,
    .modal .md\\:grid-cols-3,
    .modal .lg\\:grid-cols-3,
    #bill-reduction-modal .grid,
    #bill-reduction-modal .grid-cols-2,
    #bill-reduction-modal .grid-cols-3,
    #bill-reduction-modal .md\\:grid-cols-2,
    #bill-reduction-modal .md\\:grid-cols-3,
    #prescription-modal .grid,
    #prescription-modal .grid-cols-2,
    #prescription-modal .grid-cols-3,
    #prescription-modal .md\\:grid-cols-2,
    #prescription-modal .md\\:grid-cols-3,
    #travel-modal .grid,
    #travel-modal .grid-cols-1,
    #travel-modal .md\\:grid-cols-3,
    #benefits-modal .grid,
    #benefits-modal .md\\:grid-cols-2,
    #benefits-modal .lg\\:grid-cols-3 {
        grid-template-columns: 1fr !important; /* Force single column */
        gap: 0.75rem !important; /* Smaller gaps */
    }
    
    /* Card Scaling - SMALLER PADDING */
    .modal .card,
    .modal .bg-white,
    .modal .rounded-lg,
    .modal .rounded-xl,
    .modal .border,
    #bill-reduction-modal .card,
    #bill-reduction-modal .bg-white,
    #bill-reduction-modal .rounded-lg,
    #bill-reduction-modal .rounded-xl,
    #bill-reduction-modal .border,
    #prescription-modal .card,
    #prescription-modal .bg-white,
    #prescription-modal .rounded-lg,
    #prescription-modal .rounded-xl,
    #prescription-modal .border,
    #travel-modal .rounded-lg,
    #travel-modal .bg-gray-50,
    #benefits-modal .rounded-lg,
    #benefits-modal .border {
        padding: 0.75rem !important; /* Smaller card padding */
        margin-bottom: 0.5rem !important;
    }
    
    /* Close Button - FIXED POSITION */
    .modal button[onclick*="close"],
    #bill-reduction-modal button[onclick*="close"],
    #prescription-modal button[onclick*="close"],
    #travel-modal button[onclick*="close"],
    #benefits-modal button[onclick*="close"] {
        position: fixed !important; /* Fixed position on mobile */
        top: 1rem !important;
        right: 1rem !important;
        z-index: 1000 !important;
        background: rgba(0,0,0,0.7) !important;
        color: white !important;
        border-radius: 50% !important;
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.25rem !important;
        border: none !important;
        cursor: pointer !important;
    }
    
    /* CTA Buttons - FULL WIDTH */
    .modal button:not([onclick*="close"]),
    #bill-reduction-modal button:not([onclick*="close"]),
    #prescription-modal button:not([onclick*="close"]) {
        width: 100% !important; /* Full width buttons on mobile */
        margin: 0.5rem 0 !important; /* Smaller margins */
        padding: 0.75rem !important; /* Smaller padding */
        font-size: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    /* Spacing Optimization - AGGRESSIVE REDUCTION */
    .modal .space-y-8 > *,
    #bill-reduction-modal .space-y-8 > *,
    #prescription-modal .space-y-8 > * {
        margin-top: 0.75rem !important;
    }
    
    .modal .space-y-6 > *,
    #bill-reduction-modal .space-y-6 > *,
    #prescription-modal .space-y-6 > * {
        margin-top: 0.5rem !important;
    }
    
    .modal .space-y-4 > *,
    #bill-reduction-modal .space-y-4 > *,
    #prescription-modal .space-y-4 > * {
        margin-top: 0.375rem !important;
    }
    
    /* Margin Bottom Adjustments - SMALLER SPACING */
    .modal .mb-8,
    #bill-reduction-modal .mb-8,
    #prescription-modal .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    .modal .mb-6,
    #bill-reduction-modal .mb-6,
    #prescription-modal .mb-6 {
        margin-bottom: 0.75rem !important;
    }
    
    .modal .mb-4,
    #bill-reduction-modal .mb-4,
    #prescription-modal .mb-4 {
        margin-bottom: 0.5rem !important;
    }
    
    .modal .mb-3,
    #bill-reduction-modal .mb-3,
    #prescription-modal .mb-3,
    #travel-modal .mb-3,
    #benefits-modal .mb-3 {
        margin-bottom: 0.375rem !important;
    }
    
    .modal .mb-2,
    #bill-reduction-modal .mb-2,
    #prescription-modal .mb-2,
    #travel-modal .mb-2,
    #benefits-modal .mb-2 {
        margin-bottom: 0.25rem !important;
    }
    
    /* VIP Travel Modal Specific Fixes */
    #travel-modal .text-center {
        padding: 0.5rem !important;
    }
    
    #travel-modal .font-bold {
        font-size: 0.875rem !important;
    }
    
    /* Benefits Modal Specific Fixes */
    #benefits-modal .grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    #benefits-modal ul {
        list-style: none !important;
        padding: 0 !important;
    }
    
    #benefits-modal li {
        font-size: 0.875rem !important;
        padding: 0.25rem 0 !important;
    }
    
    /* Bill Reduction Modal - Specific Optimizations */
    #bill-reduction-modal .grid-cols-2 {
        grid-template-columns: 1fr 1fr !important; /* Allow 2 columns for bills only */
    }
    
    #bill-reduction-modal .text-3xl {
        font-size: 1.5rem !important; /* Smaller icons */
    }
    
    /* Prescription Modal - Specific Optimizations */
    #prescription-modal .flex {
        flex-direction: column !important;
    }
    
    #prescription-modal .justify-between {
        justify-content: flex-start !important;
    }
    
    #prescription-modal .bg-green-500 {
        margin-top: 0.5rem !important;
        align-self: flex-start !important;
    }
}

/* Prevent content overflow - GLOBAL FIX */
.modal-content *,
#bill-reduction-modal *,
#prescription-modal *,
#travel-modal *,
#benefits-modal * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile scrolling optimization - GLOBAL FIX */
.modal-body,
.modal .overflow-y-auto,
#bill-reduction-modal .overflow-y-auto,
#prescription-modal .overflow-y-auto {
    overflow-x: hidden !important; /* Prevent horizontal scroll */
    word-wrap: break-word !important; /* Wrap long text */
}

/* Custom Animation Classes */
.animate-in {
    animation: fadeInUp 0.6s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 1s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-slow {
    animation: pulseSlow 2s infinite;
}

.animate-count-up {
    animation: countUp 0.6s ease-out;
}

/* Video Styling */
video {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Image Optimization */
img {
    object-position: top;
    max-width: 100%;
    height: auto;
}

/* Touch-Friendly Button Enhancements */
.modal button,
button[onclick*="Modal"],
button[onclick*="close"] {
    min-height: 48px;
    min-width: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Button Spacing Improvements */
button[onclick*="Modal"] {
    padding: 1.5rem 2rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

button[onclick*="Modal"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

button[onclick*="Modal"]:active {
    transform: translateY(0);
}

/* Close Button Enhancements */
button[onclick*="close"] {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

button[onclick*="close"]:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

button[onclick*="close"]:active {
    transform: scale(0.95);
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .section-header h2 {
        font-size: 2.5rem;
    }
    
    /* Mobile Button Adjustments */
    button[onclick*="Modal"] {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0.5rem;
    }
    
    .mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-nav-link {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        color: #374151;
        transition: all 0.2s ease;
        border: none;
        background: none;
        font-size: 1rem;
        font-weight: 500;
    }
    
    .mobile-nav-link:hover,
    .mobile-nav-link:focus {
        color: #2563eb;
        background-color: #f9fafb;
    }
    
    /* Mobile modal adjustments */
    .modal .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* VIP Travel Modal Mobile Fixes */
    #travel-modal .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #travel-modal img {
        height: 8rem !important;
        object-fit: cover;
    }
    
    #travel-modal h4 {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    #travel-modal p {
        font-size: 0.75rem;
    }
    
    #travel-modal span {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Modal Grid Responsive Fixes */
    .modal .grid-cols-2,
    .modal .grid-cols-3,
    #bill-reduction-modal .grid-cols-2,
    #bill-reduction-modal .grid-cols-3,
    #prescription-modal .grid-cols-2,
    #prescription-modal .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .modal .md\:grid-cols-2,
    .modal .md\:grid-cols-3,
    #bill-reduction-modal .md\:grid-cols-2,
    #bill-reduction-modal .md\:grid-cols-3,
    #prescription-modal .md\:grid-cols-2,
    #prescription-modal .md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

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

/* Focus styles for accessibility */
button:focus,
a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Loading animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes pulseSlow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes countUp {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button hover effects */
.btn-hover {
    transition: all 0.3s ease;
}

.btn-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Text gradient effects */
.text-gradient {
    background: linear-gradient(135deg, #1d4ed8 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Backdrop blur support */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

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

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    button {
        border: 2px solid currentColor;
    }
}

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

/* ========================================== */
/* EMERGENCY MOBILE MODAL FIXES - CRITICAL   */
/* ========================================== */

/* CRITICAL FIX: Remove Modal Vertical Centering - Start from Top */
.modal-overlay {
  display: flex !important;
  align-items: flex-start !important; /* NO centering - start from top */
  justify-content: center !important;
  padding: 1rem 1rem 1rem 1rem !important; /* Minimal top padding only */
}

@media (max-width: 768px) {
  /* Modal Overlay - NO blank space at top */
  .modal-overlay {
    padding: 0.5rem !important; /* Minimal padding all around */
    align-items: flex-start !important; /* Start from very top */
    justify-content: center !important;
  }
  
  /* Modal Content - NO top spacing, start immediately */
  .modal-content {
    width: calc(100vw - 1rem) !important;
    max-width: none !important;
    height: calc(100vh - 1rem) !important; /* Use more screen space */
    max-height: calc(100vh - 1rem) !important;
    margin: 0 auto !important; /* NO top margin */
    margin-top: 0 !important; /* Force no top margin */
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
  }
  
  /* Modal Header - Minimal top space */
  .modal-header {
    flex-shrink: 0 !important;
    padding: 0.75rem !important; /* Reduced padding */
    padding-top: 0.75rem !important; /* Minimal top padding */
    margin: 0 !important; /* No margins */
    border-bottom: 1px solid #e5e7eb !important;
    position: sticky !important;
    top: 0 !important;
    background: white !important;
    z-index: 10 !important;
  }
  
  /* Modal Body - Scrollable Content */
  .modal-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0.75rem !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* Modal Footer - Fixed Bottom */
  .modal-footer {
    flex-shrink: 0 !important;
    padding: 0.75rem !important;
    border-top: 1px solid #e5e7eb !important;
    position: sticky !important;
    bottom: 0 !important;
    background: white !important;
    z-index: 10 !important;
  }

  /* Force Single Column Layouts - More Comprehensive */
  .modal-content .grid-cols-2,
  .modal-content .grid-cols-3,
  .modal-content .grid-cols-4,
  .modal-content .md\:grid-cols-2,
  .modal-content .md\:grid-cols-3,
  .modal-content .lg\:grid-cols-3,
  .modal-content .lg\:grid-cols-4,
  .modal-content [class*="grid-cols-"],
  .modal-content [class*="md:grid-cols-"],
  .modal-content [class*="lg:grid-cols-"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }
  
  /* Ensure all grid items take full width */
  .modal-content .grid > div,
  .modal-content [class*="grid"] > div {
    width: 100% !important;
    max-width: none !important;
  }
  
  /* Touch-Optimized Elements */
  .modal-content button,
  .modal-content .close-modal {
    min-height: 44px !important;
    min-width: 44px !important;
    font-size: 1rem !important;
    padding: 0.75rem 1rem !important;
    touch-action: manipulation !important;
  }
  
  .close-modal {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    z-index: 20 !important;
    background: rgba(0, 0, 0, 0.1) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Typography & Spacing - NO top gaps */
  .modal-content h1 { 
    font-size: 1.5rem !important; 
    line-height: 1.3 !important; 
    margin-top: 0 !important; /* NO top margin */
    margin-bottom: 0.75rem !important; 
  }
  .modal-content h2 { 
    font-size: 1.25rem !important; 
    line-height: 1.3 !important; 
    margin-top: 0 !important; /* NO top margin */
    margin-bottom: 0.5rem !important; 
  }
  .modal-content h3 { 
    font-size: 1.125rem !important; 
    line-height: 1.3 !important; 
    margin-top: 0 !important; /* NO top margin */
    margin-bottom: 0.5rem !important; 
  }
  .modal-content p { 
    font-size: 0.875rem !important; 
    line-height: 1.4 !important; 
    margin-top: 0 !important; /* NO top margin */
    margin-bottom: 0.5rem !important; 
  }
  .modal-content li { 
    font-size: 0.875rem !important; 
    line-height: 1.4 !important; 
  }
  
  /* Remove ALL top spacing from modal content */
  .modal-content > * {
    margin-top: 0 !important;
  }
  
  .modal-content > div:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Image/Video Mobile Optimization */
  .modal-content img {
    max-height: 120px !important;
    width: auto !important;
    object-fit: contain !important;
    margin: 0.5rem auto !important;
  }
  
  .modal-content video {
    max-height: 160px !important;
    width: 100% !important;
    margin: 0.5rem 0 !important;
  }
  
  /* Reduce all paddings and margins */
  .modal-content .p-8 { padding: 0.75rem !important; }
  .modal-content .p-6 { padding: 0.75rem !important; }
  .modal-content .p-4 { padding: 0.5rem !important; }
  .modal-content .px-8 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
  .modal-content .py-6 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
  .modal-content .mb-8 { margin-bottom: 1rem !important; }
  .modal-content .mb-6 { margin-bottom: 0.75rem !important; }
  .modal-content .mb-4 { margin-bottom: 0.5rem !important; }
  .modal-content .mt-8 { margin-top: 1rem !important; }
  .modal-content .mt-6 { margin-top: 0.75rem !important; }
  
  /* Savings Grid Mobile Fix */
  .modal-content .savings-grid,
  .modal-content .grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .modal-content .savings-grid > div,
  .modal-content .grid > div {
    margin-bottom: 0.5rem !important;
    padding: 0.5rem !important;
    width: 100% !important;
  }
  
  /* Steps Process Mobile Fix */
  .modal-content .step {
    margin-bottom: 1rem !important;
    padding: 0.75rem !important;
  }
  
  /* Benefits List Mobile Fix */
  .modal-content ul {
    padding-left: 1rem !important;
  }
  
  .modal-content li {
    margin-bottom: 0.25rem !important;
  }
  
  /* CTA Button Mobile Fix */
  .modal-content .bg-gradient-to-r {
    width: 100% !important;
    text-align: center !important;
    padding: 1rem !important;
    font-size: 1rem !important;
  }
  
  /* Critical Mobile-Specific Fixes */
  
  /* Prevent horizontal scrolling */
  .modal-content * {
    box-sizing: border-box !important;
  }
  
  /* Fix close button positioning and size */
  .close-modal {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    border: 2px solid currentColor !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
  }
  
  /* Ensure all buttons in modals are clickable */
  .modal-content button {
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }
  
  /* Ensure proper text wrapping */
  .modal-content h1,
  .modal-content h2,
  .modal-content h3,
  .modal-content h4,
  .modal-content p,
  .modal-content li {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix flex layouts for mobile */
  .modal-content .flex {
    flex-wrap: wrap !important;
  }
  
  .modal-content .flex-col {
    flex-direction: column !important;
  }
  
  /* Fix image containers */
  .modal-content .text-center {
    text-align: center !important;
    width: 100% !important;
  }
  
  /* Video player mobile optimization */
  .modal-content video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 200px !important;
  }
  
  /* Modal overlay improvements */
  .modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
  }
  
  /* CRITICAL: Full screen mobile optimization */
  .modal-overlay {
    padding: 0 !important; /* NO padding on mobile for max space */
  }
  
  .modal-content {
    width: 100vw !important; /* Full width */
    height: 100vh !important; /* Full height */
    max-height: 100vh !important;
    margin: 0 !important; /* NO margins */
    border-radius: 0 !important; /* Square corners for full screen */
  }
  
  /* Close button optimization - no space creation */
  .close-modal,
  .modal-content button[onclick*="close"],
  .modal-content button[onclick*="Close"] {
    position: absolute !important;
    top: 0.25rem !important; /* Very close to top */
    right: 0.25rem !important;
    z-index: 1001 !important;
    background: rgba(0,0,0,0.8) !important;
    color: white !important;
    border-radius: 50% !important;
    margin: 0 !important; /* NO margins */
    padding: 0.5rem !important;
  }
  
  /* Content flow - no gaps */
  .modal-content > div {
    margin-bottom: 0.5rem !important;
  }
  
  .modal-content > div:first-child {
    margin-top: 0 !important; /* First element NO top margin */
    padding-top: 0.5rem !important; /* Minimal top padding only */
  }
}

/* Desktop modal positioning - also start from top */
@media (min-width: 769px) {
  .modal-overlay {
    align-items: flex-start !important; /* Start from top on desktop too */
    padding: 2rem !important; /* More padding on desktop */
  }
  
  .modal-content {
    margin-top: 1rem !important; /* Small top margin on desktop */
    max-width: 6xl !important;
    max-height: calc(100vh - 4rem) !important;
  }
}

/* ========================================== */
/* CRITICAL: Modal-Specific Positioning Fixes */
/* ========================================== */

/* Force ALL modals to start from top - highest specificity */
#travel-modal,
#benefits-modal,
#bill-reduction-modal,
#prescription-modal {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: 0.5rem !important;
}

/* Force modal content positioning for ALL modals */
#travel-modal .modal-content,
#benefits-modal .modal-content,
#bill-reduction-modal .modal-content,
#prescription-modal .modal-content {
  margin-top: 0 !important;
  align-self: flex-start !important;
}

/* Mobile-specific modal positioning overrides */
@media (max-width: 768px) {
  #travel-modal,
  #benefits-modal,
  #bill-reduction-modal,
  #prescription-modal {
    padding: 0.25rem !important;
    align-items: flex-start !important;
  }
  
  #travel-modal .modal-content,
  #benefits-modal .modal-content,
  #bill-reduction-modal .modal-content,
  #prescription-modal .modal-content {
    margin: 0 !important;
    margin-top: 0 !important;
    transform: translateY(0) !important;
    position: relative !important;
    top: 0 !important;
  }
  
  /* Force immediate content start */
  #travel-modal .modal-header,
  #benefits-modal .modal-header,
  #bill-reduction-modal .modal-header,
  #prescription-modal .modal-header {
    margin-top: 0 !important;
    padding-top: 0.5rem !important;
  }
}

/* ========================================== */
/* OPTIMIZED: Button Functionality           */
/* ========================================== */

/* Ensure interactive elements work properly */
button, 
.btn, 
[onclick], 
a[href] {
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

/* ========================================== */
/* NUCLEAR OPTION: Override ALL centering    */
/* ========================================== */

/* Override any Tailwind classes that center modals */
.modal-overlay.flex.items-center,
.modal-overlay.items-center,
.flex.items-center.justify-center {
  align-items: flex-start !important;
}

/* Remove transforms that might center content */
.modal-content {
  transform: none !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}

/* Force all modal overlays to use flexbox start positioning */
div[id$="-modal"] {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
}

/* Additional mobile safety overrides */
@media (max-width: 768px) {
  /* Remove any positioning that creates blank space */
  .modal-content,
  .modal-content > div,
  .modal-header {
    margin-top: 0 !important;
    padding-top: 0.5rem !important;
    position: static !important;
  }
  
  /* Ensure modals fill screen from top */
  div[id$="-modal"] {
    padding: 0 !important;
    margin: 0 !important;
  }
  
  div[id$="-modal"] .modal-content {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* First visible element should have no top spacing */
  div[id$="-modal"] .modal-content > *:first-child,
  div[id$="-modal"] .modal-header {
    margin-top: 0 !important;
    padding-top: 0.25rem !important;
  }
}

/* BULLETPROOF MODAL OVERRIDE - Final Implementation */
#travel-modal, #bill-reduction-modal, #prescription-modal, #benefits-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
}

/* Mobile - remove padding to start from very top */
@media (max-width: 768px) {
    #travel-modal, #bill-reduction-modal, #prescription-modal, #benefits-modal {
        padding: 0 !important;
    }
}

/* Testimonial Carousel Styles */
.testimonial-card {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateY(0);
}

.testimonial-card.transitioning {
    opacity: 0.7;
    transform: translateY(-5px);
}

/* Testimonial Navigation Buttons */
#prev-testimonial, #next-testimonial {
    transition: all 0.2s ease-in-out !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    font-weight: bold !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    z-index: 10 !important;
    position: relative !important;
}

#prev-testimonial:hover, #next-testimonial:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2) !important;
}

#prev-testimonial:active, #next-testimonial:active {
    transform: scale(0.95) !important;
}

/* Testimonial Dots */
#testimonial-dots {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 8px !important;
    flex-wrap: nowrap !important;
}

#testimonial-dots button {
    transition: all 0.2s ease-in-out !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    min-width: 20px !important;
    min-height: 20px !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    position: relative !important;
    z-index: 10 !important;
    padding: 0 !important;
    margin: 0 4px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

#testimonial-dots button:hover {
    transform: scale(1.2) !important;
}

#testimonial-dots button:active,
#testimonial-dots button:focus {
    transform: scale(0.9) !important;
    outline: 2px solid rgba(29, 78, 216, 0.3) !important;
}

/* Override any Tailwind classes that might interfere */
#testimonial-dots button.bg-nexus-blue-600 {
    background-color: #2563eb !important;
}

#testimonial-dots button.bg-nexus-blue-200 {
    background-color: #dbeafe !important;
}

#testimonial-dots button.bg-nexus-blue-200:hover,
#testimonial-dots button.hover\:bg-nexus-blue-300:hover {
    background-color: #93c5fd !important;
}

/* Mobile Touch Enhancements for Testimonials */
@media (max-width: 768px) {
    .testimonial-card {
        touch-action: pan-y;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    #prev-testimonial, #next-testimonial {
        min-width: 48px;
        min-height: 48px;
        font-size: 1.4rem;
    }
    
    #testimonial-dots button {
        min-width: 20px;
        min-height: 20px;
        margin: 0 4px;
    }
}

/* Smooth Image Loading */
.testimonial-card img {
    transition: opacity 0.3s ease-in-out;
}

/* Animation for testimonial content updates */
@keyframes testimonialFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.testimonial-content-updated {
    animation: testimonialFadeIn 0.3s ease-out;
}

/* Star Rating Styling */
.star {
    color: #FFD700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0 1px;
    font-size: 1.125rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.star:hover {
    color: #FFA500;
    transform: scale(1.1);
}

/* Mobile Menu Styling */
#mobile-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#mobile-menu.show {
    max-height: 400px;
    opacity: 1;
}

/* Mobile Menu Button Styling */
#mobile-menu-btn {
    transition: all 0.2s ease;
}

#mobile-menu-btn:hover {
    background-color: rgba(29, 78, 216, 0.1);
}

#mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Mobile Nav Links */
.mobile-nav-link {
    transition: all 0.2s ease;
    border-radius: 0.375rem;
}

.mobile-nav-link:hover {
    background-color: rgba(29, 78, 216, 0.05);
    color: #1d4ed8;
}

.mobile-nav-link:active {
    background-color: rgba(29, 78, 216, 0.1);
}

/* Responsive Star Styling */
@media (max-width: 640px) {
    .star {
        font-size: 1rem;
        margin: 0 0.5px;
    }
}
