/* Extracted from _Layout.cshtml for better performance */

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem; /* Adjust for better fit on small screens */
    }

    .navbar-brand img {
        height: 35px; /* Slightly smaller on mobile */
    }
}

.navbar-brand {
    transition: opacity 0.2s ease;
}

    .navbar-brand:hover {
        opacity: 0.9;
    }

.brand-text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 2px !important;
    align-items: flex-start !important;
    text-align: left !important;
    padding: 0 !important;
}

.brand-text {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    line-height: 1.1;
    text-align: left !important;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

.brand-motto {
    font-size: 0.95rem;
    color: #DC2626;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.1;
    margin-top: 2px;
    text-align: left !important;
    display: block;
    margin-left: 0 !important;
    padding: 0 !important;
}

/* Reduce navbar padding and make logo fill height */
.navbar {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.navbar-brand {
    padding: 0 !important;
    display: flex;
    align-items: center;
    height: 100%;
    text-align: left !important;
    justify-content: flex-start !important;
}

.navbar-brand img {
    height: 80px !important;
    width: auto;
    display: block;
}

@media (max-width: 576px) {
    .brand-text {
        font-size: 1.25rem; /* Increased from 1.1rem for better readability */
    }
}

/* Hero content responsive styles */
.hero-content h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Handle multi-line hero text on mobile */
@media (max-width: 767px) {
    .hero-content {
        padding: 1rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    /* Ensure content doesn't overflow */
    .hero-overlay {
        overflow-y: auto;
        max-height: 100%;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.75rem; /* Increased from 1.5rem */
        line-height: 1.3; /* Better line height for mobile */
    }
    
    .hero-banner .container,
    .hero-section .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Cookie consent banner styles */
#cookieConsentBanner {
    transition: all 0.3s ease-in-out;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

    #cookieConsentBanner .btn-customize {
        border: 1px solid #fff;
        color: #fff;
        background-color: transparent;
    }

        #cookieConsentBanner .btn-customize:hover {
            background-color: rgba(255,255,255,0.1);
        }

/* Header button styles */
.navbar .btn {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar .btn-outline-primary {
    border-color: #28a745;
    color: #28a745;
}

.navbar .btn-outline-primary:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.navbar .btn-outline-primary i {
    transition: transform 0.3s ease;
}

.navbar .btn-outline-primary:hover i {
    transform: rotate(90deg);
}

.navbar .btn-primary {
    background-color: #dc3545;
    border-color: #dc3545;
}

.navbar .btn-primary:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Active button states */
.navbar .btn-outline-primary.active {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.navbar .btn-primary.active {
    background-color: #c82333;
    border-color: #bd2130;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Mobile responsive buttons */
@media (max-width: 991px) {
    .navbar .d-flex {
        margin-top: 1rem;
        width: 100%;
        flex-direction: column;
    }
    
    .navbar .d-flex .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Chat widget styles - Fix positioning */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    z-index: 1040;
    overflow: hidden;
    transition: all 0.3s ease;
    max-height: 500px;
}

    .chat-widget.collapsed {
        max-height: 60px;
    }

.chat-header {
    background: #343a40;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

    .chat-header h5 {
        margin: 0;
        font-size: 1rem;
    }

.chat-toggle {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

.chat-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 300px;
    margin-bottom: 15px;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

    .message.system {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

.message-content {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 10px;
}

/* Add padding to the bottom of the page to prevent the chat widget from covering content */
body {
    padding-bottom: 80px; /* Adjust this value based on the height of your footer */
}

/* For mobile screens, adjust the chat widget */
@media (max-width: 576px) {
    .chat-widget {
        width: 320px; /* Fixed width instead of percentage */
        right: 10px; /* Slight margin from edge */
        bottom: 70px; /* Move up to avoid footer */
        max-width: calc(100% - 20px); /* Prevent overflow */
    }
    
    .chat-header {
        padding: 10px 15px; /* Smaller padding on mobile */
    }
    
    .chat-body {
        padding: 10px;
        max-height: 300px; /* Limit height on mobile */
    }
}

/* Global hero banner mobile styles */
@media (max-width: 768px) {
    .hero-banner,
    .hero-section {
        height: auto !important;
        min-height: 250px;
    }
    
    .hero-banner .display-4,
    .hero-section .display-4 {
        font-size: 2rem !important;
    }
    
    .hero-banner .lead,
    .hero-section .lead {
        font-size: 1rem !important;
        max-width: 100% !important;
    }
    
    .hero-banner .breadcrumb,
    .hero-section .breadcrumb {
        font-size: 0.875rem;
        margin-bottom: 0.5rem !important;
    }
    
    /* Adjust composite images grid for Industries page */
    .hero-banner .col-3 {
        display: none;
    }
    
    .hero-banner .col-3:first-child,
    .hero-banner .col-3:nth-child(2) {
        display: block;
        width: 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    .hero-banner,
    .hero-section {
        height: auto !important;
        min-height: 200px;
    }
    
    .hero-banner .display-4,
    .hero-section .display-4,
    .hero-content h1 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    .hero-banner .lead,
    .hero-section .lead,
    .hero-content p.lead {
        font-size: 0.9rem !important;
        line-height: 1.4;
    }
    
    /* Reduce padding on mobile */
    .hero-banner .container,
    .hero-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Hide breadcrumb on very small screens if needed */
    .hero-banner .breadcrumb,
    .hero-section .breadcrumb {
        font-size: 0.75rem;
    }
    
    /* Carousel specific adjustments */
    .carousel-controls-container {
        bottom: 10px !important;
    }
    
    .carousel-indicators {
        margin-bottom: 0 !important;
    }
    
    /* Ensure buttons are appropriately sized */
    .hero-content .btn-lg {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Ensure images scale properly */
.hero-banner img,
.hero-section img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Fix for capabilities hero with light background */
@media (max-width: 768px) {
    .hero-banner .text-dark {
        background: rgba(255, 255, 255, 0.9);
        padding: 10px 15px;
        border-radius: 5px;
        display: inline-block;
    }
}