/* Import CSS Variables */
@import "vars.css";

/* Fonts with its fallbacks */
@font-face {
    font-family: 'Google Font Roboto Mono';
    src: url(../assets/fonts/RobotoMono-Regular.ttf);
    font-weight: 400;
}

@font-face {
    font-family: 'Google Font Roboto Mono';
    src: url(../assets/fonts/RobotoMono-Medium.ttf);
    font-weight: 500;
}

@font-face {
    font-family: 'Google Font Roboto Mono';
    src: url(../assets/fonts/RobotoMono-SemiBold.ttf);
    font-weight: 600;
}

@font-face {
    font-family: 'Google Font Roboto Mono';
    src: url(../assets/fonts/RobotoMono-Bold.ttf);
    font-weight: 700;
}
/* Basic CSS for Every Page*/
* {
    font-family: 'Google Font Roboto Mono', monospace, 'Times New Roman', Times, serif;
    font-weight: 400;
    color: var(--text-color, white);
    background-color: var(--background-color, black);
}

/* Styles for Headings on pages */

h1 > a {
    text-decoration: none;
    font-weight: 700;
}

h2 {
    font-weight: 600; 
    font-size: 2.5rem;
}

#external_links h2:has(+ a) {
    display: none;
}

/* Style for all semanticer text */
strong, em {
    color: var(--bold-text-color, thistle);
    font-weight: 600;
}

/* Styles related to the header */
header {
    display: flex;  
    flex-direction: row;
    flex-flow: nowrap;
    justify-content: space-between;
    align-items: center;
}

picture {
    margin-left: 0.5rem;
    border: 3px solid var(--border-color, white);
    border-radius: 100%;
    overflow: hidden;
    & source, & img{
        height: 5rem;
        width: auto;
        animation: rotate 1s ease-in-out infinite;
        transform-origin: center;
    }
}

#header_nav {
    margin-right: .5dvw;
}

#header_nav a{
    padding: 0 0.6dvw 0;
    text-decoration: none;
    border-radius: 1rem;
    transition: background-color 0.5s ease-out;
}

#header_nav a:hover {
    background-color: var(--hover-color, thistle);
}

/* Basic text styles for site */
main > section {
    padding: 2dvh 0 2dvh;
    margin: 0 9dvw 0;
}

section p {
    font-size: 1.5rem;
}

/* Styles for the triple buttons on home page */
#external_links {    
    display: flex;
    margin: 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    max-width: 1000px;
}

#external_links a {
    text-decoration: none;
    text-align: center;
    font-size: 1.5rem;
    padding: 1.563rem 3rem;
    margin: 1rem 0;
    background-color: var(--button-color, purple);
    border: 3px solid var(--border-color, white);
    width: 10rem;
    border-radius: 1rem;  
    transition: background-color 0.5s ease-out;  
}

#external_links a:hover {
    background-color: var(--hover-color, thistle);
}

/* Styles for project elements in index.html*/
#projects_home > h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

#projects_home h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

#projects_home a, #projects_home span {
    font-size: 1.5rem;
    font-weight: 700;
    transition: color 0.5s ease-out;
}

#projects_home a:hover, #projects_home span:hover {
    color: var(--hover-color, thistle);
}

#projects_home span {
    text-decoration: underline;
    cursor: pointer;
}

aside {
    width: 20%;
    padding-left: 0.5rem;
    margin-left: 0.5rem;
    float: right;
    box-shadow: inset 5px 0 5px -5px var(--bold-text-color, thistle);
}

project-item {
    display: block;
}

/* Styles related to the footer */
footer {
    display: flex;
    flex-flow: column wrap;
    align-items: center;
    transform: translateY(100%);
}

.back_to_top_button {
    text-align: center;
    text-decoration: none;
    width: 9rem;
    height: auto;
    border: 3px solid var(--border-color, white);
    background-color: var(--button-color, purple);
    border-radius: 1rem;
    transition: background-color 0.5s ease-out;
}

.back_to_top_button:hover {
    background-color: var(--hover-color, thistle);
    cursor: pointer;
}

/* Styles related to the form in contact.html*/
#contact_me, #contact_me_form {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2dvh 0 2dvh;
    margin: 0 9dvw 0;
}

#contact_me_form input, #contact_me_form textarea {
    background-color: var(--input-color, thistle);
    border: 3px solid var(--border-color, white);
    border-radius: 1rem;
    width: 20rem;
    height: 2rem;
}

#contact_me_form textarea {
    height: 20rem; 
    resize: none;
}

#contact_me_form input:focus, #contact_me_form textarea:focus {
    background-color: var(--focus-color, white);
    color: var(--input-text-color, black);
    z-index: 10;
}

#contact_me_form button {
    background-color: var(--button-color, purple);
    border: 3px solid var(--border-color, white);
    width: 10rem;
    height: 3rem;
    border-radius: 1rem;
    transition: background-color 0.5s ease-out;
}

#contact_me_form button:hover {
    background-color: var(--hover-color, thistle);
    cursor: pointer;
}

/* Form Error Messages */
#contact_me_form input:user-invalid, #contact_me_form textarea:user-invalid {
    border-color: var(--error-color, red);
}

#contact_me_form input:user-invalid + output > .error_message {
    display: inline-block;
}

#contact_me_form textarea:user-invalid + output > .error_message {
    display: inline-block;
}

.error_message {
    color: var(--error-color, red);
    font-size: 0.7rem;
    padding: 0;
    display: none;
}

output[name="error_message"] {
    color: var(--error-color, red);
    font-size: 0.7rem;
}

output[name="info_message"] {
    color: var(--info-color, green);
    font-size: 0.7rem;
}


/* Styles related to the PDF Resume button */
#resume_button {
    text-decoration: none;
    text-align: center;
    font-size: 1rem;
    padding: 1rem 2rem;
    background-color: var(--button-color, purple);
    border: 3px solid var(--border-color, white);
    width: 10rem;
    border-radius: 1rem;
    margin: 0 1rem 1rem;
    max-width: 31%;
    transition: background-color 0.5s ease-out;
}

#resume_button:hover {
    background-color: var(--hover-color, thistle);
    cursor: pointer;
}

/* Styles related to detail/summary tags on my resume (resume.html) */
#resume_details {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;

}

#resume_details details > summary {
    text-align: center;
    list-style: none;
    padding: 1rem;
    border-radius: 1rem;
    background-color: var(--button-color, purple);
    transition: background-color 0.5s ease-out;
}

#resume_details details > summary::-webkit-details-marker, #resume_details details > summary::marker {
    display: none;
}

#resume_details details {
    border: 3px solid var(--border-color, white);
    border-radius: 1rem;
    width: 60dvw;
    margin: 1rem;
    max-width: 40%;
    background-color: var(--button-color, purple);
    transition: background-color 0.5s ease-out;
}

/* Necessary CSS Styles to get hover/open functionality properly w/summary */
#resume_details summary:hover {
    cursor: pointer;
    background-color: var(--hover-color, thistle);
}

#resume_details details:hover:not([open]) {
    background-color: var(--hover-color, thistle); 
}

#resume_details details[open] {
    background-color: var(--background-color, black);
    transition: none;
}

#resume_details details[open] summary {
    background-color: var(--button-color, purple);
    transition: none;
}

/* Styling elements within each detail */

:is(#education, #relevant_courses, #experience, #projects) h3 {
    font-weight: 700;
    font-size: 1.3rem;
}
#projects a {
    font-weight: 700;
    font-size: 1.3rem;
}
.relevant_courses_title {
    margin: 1rem;
}

#education section {
   margin: 1rem;
}

#relevant_courses > ul {
    list-style-type: disc;
    margin: 1rem;
}

#experience *:not(summary, li) {
    margin: 1rem;
}

#projects > h3, ul {
    margin: 1rem;
}

#projects a {
    transition: color 0.5s ease-in;
}
#projects a:hover {
    color: var(--hover-color, thistle);
    transition: color 0.5s ease-out;
}

#technical_skills {
    display: block;
    justify-content: center;
    align-items: center;
}

resume-course b {
    font-weight: 500;
    color: var(--bold-text-color, purple);
}

/* Styling the tables in technical skills */
#languages_frameworks_table, #devtools_table {
    border-collapse: collapse;
    border: 3px solid var(--border-color, white);
    text-align: center;
    width: 70%;
    margin: 1rem auto;
}

#languages_frameworks_table td, #devtools_table td {
    border: 3px solid var(--border-color, white);
    padding: 0.5rem;
}

table caption {
    margin: 1rem;
    font-size: 1.3rem;
    font-weight: 700;
}

#languages_frameworks_table th, #devtools_table th {
    border: 3px solid var(--border-color, white);
    padding: 0.5rem;
    font-weight: 600;
}

/* Styling for our theme toggle switch */
/* Inspiration from https://uiverse.io/alexruix/splendid-liger-23*/
/* The switch - the box around the slider */
.switch {
    position: absolute;
    width: 2.7em;
    height: 1.7em;
    right: 0;
    margin-right: .5dvw;
    float: right;
    z-index: 100;
}
  
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    float: right;
}
    
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-color, black);
    border: 3px solid var(--border-color, white);
    transition: .5s;
    border-radius: 1rem;
}
  
.slider:before {
    position: absolute;
    content: "";
    height: 1em;
    width: 1em;
    border-radius: 1rem;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    box-shadow: inset 8px -4px 0px 0px var(--sun-moon-color, yellow);
    background: var(--background-color, black);
    transition: .5s;
}
  
input:checked + .slider {
    background-color: white;
    border: 3px solid black;
}
  
input:checked + .slider:before {
    transform: translateX(100%);
    box-shadow: inset 15px -4px 0px 15px var(--sun-moon-color, yellow);
}

/* Styles for mobile devices/tablets */
/* For phones and tablets */
@media only screen and (min-width: 280px) and (max-width: 1024px) and (hover:none) {
    header {
        display: flex;
        flex-direction: column;
    }

    h1 {
        text-align: center;
    }

    aside {
        font-size: 2rem;
        width: 50%;
        padding-left: 0.5rem;
        margin-left: 0.5rem;
        float: right;
    }

    picture {
        margin: 0;
        & source, & img {
            height: 10rem;
            width: auto;
        }
    }

    h1 {
        font-size: 4rem;
    }

    #header_nav {
        margin: 0;
    }

    #header_nav > a {
        font-size: 2rem;
    }

    footer {
        display: flex;
        flex-direction: column;
        align-content: center;
        & p {
            text-align: center;
        }
    }

    .back_to_top_button {
        padding: 1rem;
        text-align: center;
    }

    #contact_me_form input, textarea {
        width: 40rem;
        height: 2rem;
    }
    
    #contact_me_form textarea {
        height: 35rem;
    }

    #contact_me > h2 {
        font-size: 3rem;
    }

    #contact_me_form label {
        font-size: 2rem;
    }

    #contact_me_form button {
        width: 20rem;
        height: 6rem;
        font-size: 2rem;
    }

    #resume_button {
        font-size: 2rem;
        width: 20rem;
    }

    #resume_details details {
        font-size: 2rem;
        min-width: 80dvw;
    }

    table caption {
        margin: 1rem;
        font-size: 2rem;
        font-weight: 700;
    }

    :is(#education, #relevant_courses, #experience, #projects) h3 {
        font-weight: 700;
        font-size: 2rem;
    }
    #projects a {
        font-weight: 700;
        font-size: 2rem;
    }
}

/* For desktop, screen resizing styles. */
@media (max-width: 850px) {
    header {
        display: flex;
        flex-direction: column;
    }
    aside {
        width: 50%;
        padding-left: 0.5rem;
        margin-left: 0.5rem;
        float: right;
        box-shadow: inset 5px 0 5px -5px var(--bold-text-color, thistle);
    }

    #resume_details details {
        min-width: 60%;
    }
}
/* Styles for landscape tablets */
@media only screen and (min-width: 280px) and (max-width: 1025px) and (hover:none) and (orientation: landscape) {
    picture {
        margin: 0;
        & source, & img {
            height: 6rem;
            width: auto;
        }
    }
}

@keyframes rotate {
    0% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
    100% {
        transform: rotate(-5deg);
    }
}

/* CSS for use of Transition API */

/* No transitions for motion sickness users */
@media not (prefers-reduced-motion: reduce) {
    header {
        view-transition-name: main-content;
    }

    .switch {
        view-transition-name: theme-switch;
    }
}

::view-transition-old(root),
::view-transition-new(root) {
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform-origin: left center;
}

::view-transition-old(root) {
    animation: 0.25s linear both move-out;
}
  
::view-transition-new(root) {
    animation: 0.25s linear both move-in;
}

@keyframes move-in {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(0);
    }
}
  
@keyframes move-out {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(100%);
    }
}