/* Custom CSS for BECCS Connect - Mobile Responsiveness */

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ensure all containers respect viewport width */
.container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Mobile-first responsive adjustments */
@media (max-width: 640px) {
    /* Ensure text doesn't overflow on small screens */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Prevent images from causing overflow */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure buttons and inputs don't overflow */
    button, input, textarea {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Adjust spacing for mobile */
    .py-24 {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Ensure grid items stack properly */
    .grid {
        gap: 1.5rem;
    }
}

/* Ensure modals are mobile responsive */
.modal {
    padding: 1rem;
}

@media (max-width: 640px) {
    .modal {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
}

/* Fix for any potential overflow issues */
* {
    box-sizing: border-box;
}

/* Ensure smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Header scroll effect styles */
#header {
    transition: all 0.5s ease-in-out;
}

#header.header-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

#header.header-scrolled .nav-link {
    color: #1f2937 !important;
}

#header.header-scrolled #menu-toggle {
    color: #1f2937;
}

/* Mobile menu improvements */
@media (max-width: 768px) {
    #nav-menu {
        width: 100vw;
        max-width: 100vw;
    }
    
    #header.header-scrolled {
        background-color: rgba(255, 255, 255, 0.98);
    }
}

/* Chatbot mobile improvements */
@media (max-width: 640px) {
    #chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    #chat-window {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        right: 0;
    }
}

/* Ensure partner logos don't cause overflow */
@media (max-width: 640px) {
    .partner-logo {
        max-width: 120px;
        height: auto;
    }
}

/* Fix for any absolute positioned elements */
.absolute {
    max-width: 100vw;
}

/* Ensure proper text wrapping */
p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile-specific button improvements */
@media (max-width: 640px) {
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Ensure proper spacing in mobile navigation */
@media (max-width: 768px) {
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* Fix for any potential flex overflow */
.flex {
    flex-wrap: wrap;
}

/* Ensure proper container behavior */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile-specific image handling */
@media (max-width: 640px) {
    .aspect-square {
        aspect-ratio: 1;
    }
    
    .aspect-4-3 {
        aspect-ratio: 4/3;
    }
}

/* Ensure proper form element sizing */
input, textarea, select {
    width: 100%;
    max-width: 100%;
}

/* Mobile-specific spacing adjustments */
@media (max-width: 640px) {
    .space-y-8 > * + * {
        margin-top: 1.5rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 1.25rem;
    }
    
    .space-y-4 > * + * {
        margin-top: 1rem;
    }
}

/* Ensure proper modal behavior on mobile */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }
}

/* Fix for any potential grid overflow */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

/* Ensure proper text sizing on mobile */
@media (max-width: 640px) {
    .text-6xl {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .text-5xl {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .text-4xl {
        font-size: 2rem;
        line-height: 1.25;
    }
    
    .text-3xl {
        font-size: 1.875rem;
        line-height: 1.25;
    }
    
    .text-2xl {
        font-size: 1.5rem;
        line-height: 1.25;
    }
    
    .text-xl {
        font-size: 1.25rem;
        line-height: 1.25;
    }
}

/* Ensure proper iframe behavior */
iframe {
    max-width: 100%;
    width: 100%;
}

/* Fix for any potential absolute positioning issues */
.relative {
    position: relative;
    overflow: hidden;
}

/* Ensure proper button sizing on mobile */
@media (max-width: 640px) {
    button {
        min-height: 44px; /* Touch target size */
    }
}

/* Fix for any potential flex item overflow */
.flex > * {
    min-width: 0;
}



.hover-scale {
    transition: transform 0.2s ease-in-out;
}

/* * This rule applies when the user's mouse is over the button.
 * It scales the button up to 105% of its original size.
*/
.hover-scale:hover {
    transform: scale(1.05);
}

/*
 * This rule applies during the moment the user clicks the button.
 * It scales the button down slightly to 98% of its original size,
 * giving a "pressed" feedback effect.
*/
.hover-scale:active {
    transform: scale(0.98);
}



/* Ensure proper text alignment on mobile */
@media (max-width: 640px) {
    .text-center {
        text-align: center;
    }
    
    .text-left {
        text-align: left;
    }
    
    .text-right {
        text-align: right;
    }
}

/* Header text color transitions */
#header .nav-link {
    transition: color 0.3s ease-in-out;
}

#header:not(.header-scrolled) .nav-link {
    color: #1f2937 !important;
}

#header:not(.header-scrolled) #menu-toggle {
    color: #1f2937;
} 