/* Google fonts import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

/* Asterisk wildcard selector to override default styles added by the browser */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* General styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Generic project styles */
    color: #3a3a3a;
    font-family: 'Roboto', sans-serif;
    padding: 0;
    margin: 0;
}

h1,
h2,
h3 {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #252525;
}

.hidden-heading {
    display: none;
}

/* Header */
header {
    background-color: #ffffff;
    padding: 0 1rem;
    position: fixed;
    z-index: 99;
    width: 100%;
    box-shadow: 0 2px 2px #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

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

#logo {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #252525;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

#menu {
    font-size: 110%;
    letter-spacing: 4px;
    list-style-type: none;
}

#menu>li {
    margin-bottom: 1em;
}

.active {
    border-bottom: 1px solid #3a3a3a;
}

/* Navbar styles with dropdown toggle */
nav {
    position: absolute;
    background-color: #ffffff;
    width: 100%;
    left: 0;
    padding: 0 1rem;
    box-shadow: 0 2px 2px #3a3a3a;
    display: none;
    top: 100%;
}

/* Nav toggle */
#nav-toggle:checked~nav {
    display: block;
}

#nav-toggle {
    display: none;
}

.nav-toggle-label {
    font-size: 2rem;
}

/* Main content */
main {
    /* Make main element take up any surplus space to push footer down */
    flex: 1 0 auto;
    /* Add margin at the top to prevent content from being covered by the header */
    margin-top: 47px;
}

/* Hero section */
#hero {
    height: 600px;
    width: 100%;
    background: url("../images/hero-image.jpg") no-repeat center center/cover;
    position: relative;
}

#cover-text {
    /* Semi-transparent dark overlay */
    background-color: rgba(33, 37, 41, 0.8);
    font-size: 130%;
    position: absolute;
    bottom: 30px;
    width: 80%;
    min-height: 200px;
    padding-top: 40px;
    padding-left: 10px;
}

#cover-text>h2,
#cover-text>h3 {
    color: #ffffff;
}

/* Reasons section */
#reasons {
    width: 90%;
    margin: 20px auto;
}

#reasons h2 {
    margin-bottom: 20px;
    text-align: center;
    font-size: 280%;
}

#benefits-physical>div,
#benefits-mental>div {
    line-height: 20px;
    margin-bottom: 20px;
}

#benefits p {
    padding: 0 20px;
}

#benefits hr {
    border-top: 1px solid #3a3a3a;
    margin: 5px 0;
}

#circle-cover-bg {
    background: url("../images/reasons-image.jpg") no-repeat top center/cover;
    height: 90vh;
    width: 90vw;
    margin-bottom: 20px;
    /* Makes the square into a circle */
    border-radius: 50%;
    max-width: 300px;
    max-height: 300px;
}

#benefits-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Training Times section */
#times {
    background: url('../images/training-times.jpg') no-repeat center/cover;
    /* Handles responsivity without the need for a media query */
    display: flex;
    flex-wrap: wrap;
}

#times div {
    color: #fafafa;
    background-color: rgba(0, 0, 0, .6);
    padding: 15px;
    text-align: center;
    /* This will not wrap on screens of less than 400px wide.
    Each div will expand to fill the available space on its row */
    flex-basis: 200px;
    flex-grow: 1;
    /* Creates a grid of time divs over the background image */
    border: 2px solid white;
}

#times h3 {
    /* Override the heading colour set in general styles */
    color: #fafafa;
}

/* Personal Training Times section */
#pt-schedule {
    background: url('../images/pt-background.jpg') no-repeat center/cover;
    display: flex;
    flex-wrap: wrap;
}

#pt-schedule div {
    color: #fafafa;
    background-color: rgba(33, 37, 41, 0.75);
    padding: 15px;
    text-align: center;
    flex-basis: 200px;
    flex-grow: 1;
    border: 2px solid white;
}

#pt-schedule h3 {
    color: #fafafa;
}

/* Gallery page */
#photos img {
    width: 100%;
    line-height: 1em;
}

#photos {
    line-height: 0;
}

/* Signup Form */
#signup {
    background-image: url("../images/signup-background.jpg");
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 40px 0;
}

#signup-form {
    background-color: rgba(33, 37, 41, 0.9);
    color: #ffffff;
    border: none;
}

#signup-form h2 {
    color: #ffffff;
    font-size: 1.5rem;
}

#signup-form .form-label {
    color: #ffffff;
    font-weight: 500;
}

#signup-form .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

#signup-form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

#signup-form .form-check-label {
    color: #ffffff;
}

#signup-form .btn-dark {
    background-color: #212529;
    border-color: #212529;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#signup-form .btn-dark:hover {
    background-color: #ffffff;
    color: #212529;
    border-color: #ffffff;
}

/* Footer */
#social-networks {
    text-align: center;
    padding: 20px 0;
    display: flex;
    justify-content: space-evenly;
    list-style-type: none;
}

#social-networks i {
    font-size: 160%;
    padding: 5%;
    color: #3a3a3a;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #252525;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.back-to-top:hover {
    background-color: #3a3a3a;
    transform: translateY(-3px);
    transition: all 0.3s;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Media query: large or landscape phones (576px and up) */
@media screen and (min-width: 576px) {

    /* Gallery */
    #photos {
        column-count: 2;
        column-gap: 0;
    }
}

/* Media query: tablets and larger (768px and up) */
@media screen and (min-width: 768px) {

    /* Header */
    nav {
        display: block;
        position: relative;
        box-shadow: none;
        width: fit-content;
        padding-right: 1rem;
    }

    #menu {
        display: flex;
    }

    #menu>li {
        padding-left: 1rem;
    }

    .nav-toggle-label {
        display: none;
    }

    #logo {
        font-size: 280%;
        line-height: 75px;
        margin: 0 0.5rem;
    }

    /* Main content */
    main {
        /* Push main content down to accommodate larger header */
        margin-top: 79px;
    }

    /* Hero */
    #cover-text {
        width: 300px;
        right: 50px;
    }

    /* Reasons section */
    #benefits-physical,
    #benefits-mental {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    #benefits-physical>div,
    #benefits-mental>div {
        width: 75%;
    }

    #benefits-mental>div {
        text-align: end;
        align-self: flex-end;
    }

    /* Gallery */
    #photos {
        column-count: 3;
    }

    /* Signup Form */
    #signup-form h2 {
        font-size: 2rem;
    }

    /* About Page */
    #about-hero {
        background-image: url("../images/about-hero.jpg");
        background-size: cover;
        background-position: center;
        min-height: 400px;
        display: flex;
        align-items: center;
        position: relative;
    }

    #about-hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
    }

    #about-hero .container {
        position: relative;
        z-index: 1;
    }

    #our-story {
        background-color: #f8f9fa;
    }

    /* Testimonials Carousel */
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        background-color: #212529;
        border-radius: 50%;
        padding: 20px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 5%;
    }

    .carousel-indicators button {
        background-color: #212529;
    }
}



/* Large devices (laptops and desktops, 992px and up) */
@media screen and (min-width: 992px) {
    #menu a:hover {
        border-bottom: 1px solid #3a3a3a;
    }

    /* Gallery */
    #photos {
        column-count: 3;
    }
}

@media screen and (min-width: 1200px) {

    /* Reasons section */
    #benefits {
        display: flex;
        flex-direction: row;
    }

    #benefits>div {
        flex: 1;
    }

    #benefits-image {
        order: 0;
    }

    #benefits-mental {
        order: 1;
    }

    #benefits-mental>div {
        align-self: flex-start;
    }

    #benefits-physical>div {
        align-self: flex-end;
    }
}

/* Fix nav alignment on signup page */
body:has(#signup) nav {
    padding-top: 0;
}

body:has(#signup) #menu {
    margin: 0;
}