/* Small devices (portrait tablets and large phones, 600px and up) */
/* Defining some variables to be used in the styles */
:root {
    --bg-color: #0f1016;
    --text-color: white;
    --main-color: #25d74e;
    --second-color: gray;
    --h1-font: 60px;
    --h2-font: 40px;
    --h3-font: 20px;
    --h4-font: 17px;
    --h5-font: 13px;
    --p-font: 13px;
    --border-radius: 5px;
    --spacing-unit: 10px;
    --nav-font: 22px;
    --skill-img-size: 40px;
}


/* General styles */
* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-color);
    padding: 0;
    margin: 0;
    scroll-behavior: smooth;
}

h1 {
    font-size: var(--h1-font);
    margin-bottom: calc(4*var(--spacing-unit));
}

h2 {
    font-size: var(--h2-font);
    margin-bottom: calc(2*var(--spacing-unit));
}

h3 {
    font-size: var(--h3-font);
    margin-bottom: calc(2*var(--spacing-unit));
    color: var(--main-color);
}

h4 {
    font-size: var(--h4-font);
    margin-bottom: var(--spacing-unit);
    color: var(--main-color);
}

h5 {
    font-size: var(--h5-font);
    margin-bottom: var(--spacing-unit);
}

p {
    font-size: var(--p-font);
    margin-bottom: var(--spacing-unit);
    color: var(--second-color);
}

body {
    background-color: var(--bg-color);
}

header {
    position: fixed;
    width: 100%;
    background-color: black;
    opacity: 0.9;
    font-size: var(--nav-font);
    font-weight: bold;

    .hotbar {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .bx-menu {
            cursor: pointer;
        }

        .logo, .bx-menu {
            margin: var(--spacing-unit) calc(2 * var(--spacing-unit));
        }

        .logo {
            text-decoration: none;

            span {
                color: var(--main-color);
            }
        }
    }

    #navbar{
        display: none;
        list-style-type: none;
    
        a {
            display: block;
            padding: var(--spacing-unit) calc(2 * var(--spacing-unit));
            text-decoration: none;
            width: 100%;
        }
    
        a:hover {
            background-color: var(--main-color);
        }
    }
}

#home {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;

    img {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top;/* Crop from the bottom */
        z-index: -1;
    }

    .home-text {
        margin: calc(5*var(--spacing-unit));

        h3, h4 {
            text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
        }
    }
}

#about {
    overflow: auto;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-color);

    img {
        display: block;
        max-width: 200px;
        max-height: 200px;
        border-radius: 30%;
        margin: calc(5*var(--nav-font)) auto calc(3*var(--spacing-unit));
    }

    .about-text{
        max-width: 70%;
        margin: auto;

        .abilities{
            list-style-position: inside;
            margin: calc(3*var(--spacing-unit)) auto;
            h3 {
                color: var(--text-color);
            }
        }
    }
}

#skills {
    overflow: auto;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-color);
    text-align: center;

    h2 {
        margin: calc(5*var(--nav-font)) auto var(--spacing-unit);
    }

    h4 {
        margin-left: 10%;
        margin-right: 10%;
    }

    .skills-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        margin: calc(2*var(--spacing-unit)) 10% 0;

        .skill {
            border-radius: 5px;
            margin: 10px auto;
            transition: all .40s ease;
        }

        /* Creates the line to show when a skill is hovered */
        .skill::after {
            content: '';
            display: block;
            width: 0;
            height: 4px;
            margin: 8px auto 0;
            border-radius: 2px;
            background: var(--main-color);
            transition: width 0.4s ease;
        }

        .skill:hover {
            transform: translateY(-10px);
        }

        /* Shows the line when the skill is hovered */
        .skill:hover::after {
            width: 70%;
        }

        h5 {
            margin: 10px auto 0;
            font-style: italic;
            text-align: center;
        }

        .img-border {
            width: calc(1.6*var(--skill-img-size));
            height: calc(1.6*var(--skill-img-size));
            margin: auto;
            border-radius: 50%;
            background-color: white;
        }

        img {
            width: var(--skill-img-size);
            height: var(--skill-img-size);
            /* Centers image by calculating margin based on img-border size */
            margin: calc(0.3*var(--skill-img-size)) auto;
        }
    }
}

#projects {
    overflow: auto;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-color);

    .projects-content {
        margin: calc(5*var(--nav-font)) auto auto;
        text-align: center;
        max-width: 70%;
        .projects-container {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            gap: calc(3*var(--spacing-unit));
            margin: calc(3*var(--spacing-unit)) auto;

            .project-card {
                max-width: 400px;
                transition: all .40s ease;
                text-decoration: none;
                border-radius: var(--border-radius);

                img {
                    width: 300px;
                    height: 200px;
                    object-fit: cover;
                    border-radius: var(--border-radius);
                }

                h5 {
                    margin: 10px auto;
                    font-style: italic;
                }
                
                &:hover {
                    transform: translateY(-10px);
                }

                /* Creates the line to show when a skill is hovered */
                &::after {
                    content: '';
                    display: block;
                    width: 0;
                    height: 4px;
                    margin: 20px auto 0;
                    border-radius: 2px;
                    background: var(--main-color);
                    transition: width 0.4s ease;
                }

                    /* Shows the line when the skill is hovered */
                &:hover::after {
                    width: 70%;
                }

            }
        }
    }
}

#contact {
    overflow: auto;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-color);

    .contact-content {
        margin: calc(5*var(--nav-font)) auto;
        text-align: center;
        max-width: 70%;

        .contact-form {
            margin: auto;
            input, textarea{
                display: block;
                margin: calc(2*var(--spacing-unit)) auto;
                border-radius: var(--border-radius);
                padding: 10px;
                width: min(100%, 500px);
                color: black;
                resize: none;
            }

            textarea {
                height: 200px;
            }
        }

        .social-medias {
            margin: calc(3*var(--spacing-unit)) auto;

            a {
                font-size: var(--h3-font);
                margin: 0 calc(2*var(--spacing-unit));
                color: var(--main-color);
            }
        }
    }
}

.button {
    display: inline-block;
    text-decoration: none;
	padding: 7px 13px;
	border-radius: var(--border-radius);
	font-size: var(--h5-font);
	background: var(--main-color);
	color: var(--text-color);
	border: 1px solid var(--main-color);
	transition: all .40s ease;
    cursor: pointer;

    &:hover {
        background-color: transparent;
        color: var(--main-color);
    }
}

.to-top{
	position: fixed;
	bottom: 20px;
	right: 20px;
    color: var(--text-color);
    background: var(--main-color);
    border: 1px solid var(--main-color);
    padding: 5px;
    border-radius: 5px;
    text-decoration: none;
    
    .bx-up-arrow-alt {
        display: block;
        font-size: 15px;
    }
    &:hover {
        background-color: transparent;
    }
}