/* Reset and Base Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none; /* Chrome, Safari, Opera */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    user-select: none;         /* Standard syntax */
}

html {
    scroll-behavior: smooth;
}

body {
    /*  Default Color Variables, Used to Apply to Child Properties and Attributes */
    --background-rgb: 255, 255, 255;
    --text-rgb: 0, 0, 0;
    --overstate-rgb: 255, 255, 255;
    --understate-rgb: 0, 0, 0;

    /* Apply Color Variables to Body */
    color: rgb(var(--text-rgb));
    background-color: rgb(var(--background-color-rgn));

    padding-top: 70px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    overflow-y: scroll;
    padding-right: 0;
}

/* Header */
header {
    background: #000;
    color: #fff;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    text-decoration: underline;
}

button {
    background-color: rgb(var(--understate-rgb), 0.20);
    border: 1px solid rgba(var(--overstate-rgb), 0.36);
    color: rgb(var(--text-rgb));
    backdrop-filter: blur(1px); /* Adjust the blur amount */
    padding: 0.75rem;
    border-radius: 5px;
    width: 255px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}
button:hover {
    background-color: rgb(var(--text-rgb));
    border: 1px solid rgba(var(--text-rgb));
    color: rgb(var(--background-rgb));
}

/* Logo: Left-Aligned by Default */
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Center the logo when navigation is hidden */
body.narrow-chat-hidden .logo,
body.wide-chat-visible-narrow-content .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Main Navigation: Centered */
.main-nav {
    display: flex;
    gap: 1rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Hide main navigation in specified conditions */
body.narrow-chat-hidden .main-nav,
body.wide-chat-visible-narrow-content .main-nav {
    display: none;
}

/* Menu Icon: Right-Aligned */
.menu-icon {
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
}

/* Stack Menu Icon and Dropdown */
.menu-toggle {
    display: none;
}

.dropdown-menu {
    display: none;
    flex-direction: column;
    background-color: inherit;
    position: absolute;
    top: 3rem;
    right: 0;
    width: 200px;
    padding: 1rem;
}

.menu-toggle:checked + .menu-icon + .dropdown-menu {
    display: flex;
}

.dropdown-menu a {
    padding: 0.5em 0.5em 0;
}

/* Responsive Menu Adjustments */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .menu-icon {
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    margin-left: auto;
    }

    .all-menus {
        display: block;
    }

    .dropdown-only {
        display: none;
    }
}

/* Sections Defaults */
.section {

    color: rgb(var(--text-rgb));
    background-color: rgb(var(--background-rgb));

    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;

    min-height: 100vh;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1;
}

.section h2 {
    max-width: 800px;
    width: 100%;
    font-size: 3.14em;
    margin-bottom: 0;
    padding: 1rem 0rem;
}

.section h3 {
    max-width: 800px;
    width: 100%;
    font-size: 1.337em;
    margin-bottom: 0;
    padding: .5rem 0rem;
}

.section p {
    max-width: 800px;
    width: 100%;
    font-size: 1em;
    padding-bottom: 1em;
}

/* Individual Backgrounds */
#formula {
    background-image: url('../img/formula_bg.jpeg');
}

#engineer {
    --background-rgb: 3,80,155;
    --text-rgb: 255, 255, 255;
    --overstate-rgb: 3,80,155;
    --understate-rgb: 0, 0, 0;

    background-image: url('../img/engineer_bg.jpeg');
}

#manage {
    --background-rgb: 0, 0, 0;
    --text-rgb: 238, 232, 170;
    --overstate-rgb: 238, 232, 170;
    --understate-rgb: 0, 0, 0;

    background-image: url('../img/manage_bg.jpeg');
}

#support {
    --background-rgb: 0, 0, 0;
    --text-rgb: 255, 255, 255;
    --overstate-rgb: 255, 255, 255;
    --understate-rgb: 0, 0, 0;

    background-image: url('../img/support_bg.jpeg');
    background-position: left;
}

#support p {
    text-align: left;
}

#support h2 {
    text-align: left;
}

/* Contact Section */
#contact {
    --background-rgb: 0, 0, 0;
    --text-rgb: 255, 255, 255;
    --overstate-rgb: 0, 0, 0;
    --understate-rgb: 0, 0, 0;
}

/* Form Styling */
form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 640px;
    width: 100%;
    margin-top: 1rem;
}

form input, form textarea, form button {
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
}


/* Footer */
footer {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 1rem;
}


/* Chat Section: Default Style */
.chat-section {
    background-color: #000;
    position: fixed;
    top: 0;
    right: 0;
    min-width: 360px;
    height: calc(var(--vh) * 100);
    transform: translateX(360px); /* Hide by default on wide view */
    transition: transform 0.3s ease;
    z-index: 2000;
    display: none;
    transition: height 0.3s ease; /* Smooth height transition */
}

/* Chat Top Bar */
.chat-top-bar {
    color: #fff;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}


/* Close Icon Style */
.chat-close-icon {
    font-size: 1.25rem;
    margin-right: .2rem;
    cursor: pointer;
    color: #fff;
    margin-left: auto;
}


/* Fullscreen iframe within chat section */
.chat-iframe {
    width: 360px; /* Full width of chat section */
    height: 100%; /* Full height of chat section */
    border: none;
    overflow: hidden;
}

/* Show chat section in wide view */
body.chat-visible .chat-section {
    display: block;
    transform: translateX(0); /* Slide in on wide view */
}

/* Center Chat Section in Narrow View with Background Blur */
body.narrow-chat-visible .chat-section {
    position: fixed;
    top: 70px; /* Start below the header */
    left: 0;
    width: 100%; /* Full viewport width */
    height: calc(var(--vh) * 100 - 70px); /* Full viewport height minus header */
    transform: none; /* Remove translateX */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Condition-Based Styles */

/* Condition: Wide view, chat hidden */
body.wide-chat-hidden {
    padding-right: 0;
}

body.wide-chat-hidden header {
    width: 100%;
}

/* Condition: Narrow view, chat hidden */
body.narrow-chat-hidden {
    padding-right: 0;
}

body.narrow-chat-hidden header {
    width: 100%;
}

/* Condition: Wide view, chat visible, wide remaining content */
body.wide-chat-visible-wide-content {
    padding-right: 360px;
}

body.wide-chat-visible-wide-content header {
    width: calc(100% - 360px);
}

/* Condition: Wide view, chat visible, narrow remaining content */
body.wide-chat-visible-narrow-content {
    padding-right: 360px;
}

body.wide-chat-visible-narrow-content header {
    width: calc(100% - 360px);
}

/* Condition: Narrow view, chat visible */
body.narrow-chat-visible header {
    width: 100%;
}

body.narrow-chat-visible {
    overflow: hidden;
}

body.narrow-chat-visible .chat-top-bar{
    top: 70px;
}


/* Flex Container Based on Conditions */
.flex-container {
    display: flex;
    max-width: 768px;
}

.twocolumn {
    display: inline-block;
    min-width: 360px;
    text-align: center;
}

#contact button {
    width: 360px;
    font-size: 1rem;
}

#contact button.left {
    text-align: left;
}

#contact button i.large {
    font-size: calc(360px - 3rem);
}

#contact button:has(i.left-middle) i {
    position: absolute;
    top: calc(50% - 1rem);
    left: 1.5rem;
    font-size: 2rem;
}

#contact button:has(i.left-top) i {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-size: 2rem;
}


#contact button label {
    display: relative;
    display: block;
    padding: .5rem 1rem .5rem 4rem;
    cursor: pointer;
    
}

body.wide-chat-visible-narrow-content .flex-container,
body.narrow-chat-visible .flex-container, body.narrow-chat-hidden .flex-container{
    flex-direction: column;
    align-items: center;
}

