/* General variables */
:root {
    --background:rgb(0, 90, 153); /* Dark Blue for main background */
    --text:rgb(255, 255, 255); /* White for text */
    --background-button:rgb(0, 119, 204); /* Primary Blue for buttons */
    --background-button-hover:rgb(125, 162, 206); /* Subtle Blue for button hover state */
    --text-button:rgb(0, 0, 0); /* Black text for buttons */
    --background-header-begin:rgb(0, 90, 153); /* Dark Blue gradient start for header */
    --background-header-end:rgb(0, 119, 204); /* Primary Blue gradient end for header */
    --background-card-begin:rgba(230, 244, 255, 0.7); /* Light Blue for card gradient start */
    --background-card-end:rgba(0, 119, 204, 1); /* Primary Blue for card gradient end */
    --background-home:rgb(247, 247, 247); /* Light Gray for home section background */
    --background-hover:rgb(220, 220, 220); /* Mid Gray for hover state */
    --background-selected:rgb(0, 119, 204); /* Primary Blue for selected state */
    --border-line:rgb(0, 119, 204); /* Primary Blue for border lines */
    --background-first-section: var(--background-home); /* Use background home color */
    --text-first-section:rgb(0, 0, 0); /* Black for text */
    --background-second-section:rgb(230, 244, 255); /* Light Blue for alternating section background */
    --text-second-section:rgb(20, 20, 20); /* Slightly off-black for readability */
    --background-minigames:rgb(240, 120, 0); /* This can be an accent color */
    --text-minigames:rgb(0, 240, 160); /* This can be another accent color */
    --background-footer-begin:rgb(0, 119, 204); /* Primary Blue for footer gradient start */
    --background-footer-end:rgb(125, 162, 206); /* Subtle Blue for footer gradient end */
    --link-text:rgb(30, 30, 30); /* Slightly off-black for links */
    --hover-text:rgb(90, 90, 90); /* Dark Gray for hover state on text */
    --text-home:rgb(0, 0, 0); /* Black for text */
    text-overflow: ellipsis;
}


/* Default settings for the whole page */
body {
    background-color: var(--background);
}

a {
    color: var(--link-text);
    text-decoration: none;
}

a:hover {
    color: var(--hover-text);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    color: var(--text);
}

h1 {
    font-size: 50px;
}

p {
    margin: 0;
    text-align: center;
    width: 0;
}

button {
    border: 0ch;
    background: none;
}

.border-line-l {
    padding: 20px;
    border-left: 1px solid var(--border-line)
}

.border-line-r {
    padding: 20px;
    border-right: 1px solid var(--border-line)
}

iframe {
    border: 0;
}

@keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
}

@keyframes fadeOut {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
}

@keyframes typing {
    from { 
      width: 0; 
    }
    to { 
      width: 100%; 
    }
}

@keyframes blink-caret {
    from, to { 
      border-color: transparent; 
    }
    50% { 
      border-color: black; 
    }
}

.typing-text {
    border-right: 0.15em solid black; /* Creates the blinking cursor effect */
    animation: typing 2s steps(40, end), blink-caret 0.5s step-end 4;
    width: 100%;
}
/* **********         CSS for navbar         ********** */
.navbar {
    background-color: var(--background);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 8fr 1fr;
    justify-content: space-between; /* Distribute the links across the full width */
    transition: top 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}
  
.navbar-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    background-color: var(--text);
}
  
.navbar-toggle .bar {
    width: 25px;
    height: 3px;
    margin: 4px 0;
}

.navbar-links {
    grid-column: 2;
    width: 100%;
    display: flex;
    justify-content: center; /* Center the navbar content horizontally */
    margin: 0 auto; /* Add auto margin to center the content within the navbar */  
}

.navbar > div > a {
    display: block;
    color: var(--background-home);
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
    flex-grow: 1; /* Allow the links to flex and fill the available space */
    white-space: nowrap;
}

.navbar > div > a:hover {
    background-color: var(--background-hover);
    color: var(--text-home);
    text-shadow: 0 0 0;
}

.active {
    background-color: var(--background-selected);
    color: var(--text);
    text-shadow: 2px 2px 4pxrgba(0, 0, 0, 0.8);
}

.shadow {
    box-shadow: 2px 2px 50pxrgba(0, 0, 0, 0.8);
}

/* **********       CSS for Night-mode       ********** */
.night-mode-container {
    grid-column: 3;
    padding: 7.5px 15px;
    text-align: right;
}
/* **********    End of CSS for Night-mode   ********** */

/* **********      End of CSS for navbar     ********** */


/* **********         CSS for header         ********** */
.header {
    padding: 20px;
    background-color: var(--background-header);
    background-image: linear-gradient(to top right, var(--background-header-begin),var(--background-header-end));
}

.profile-picture {
    width: 150px; /* Adjust the width and height based on your preference */
    height: 150px;
    border-radius: 50%; /* Create a circular shape */
    overflow: hidden; /* Hide any overflowing content */
    height: auto;
    object-fit: cover; /* Ensure the image covers the entire space within the circle */
    box-shadow: 0 0 10pxrgba(0, 0, 0, 0.5);
    grid-column: 1;
    margin-right: 25px;
}

.header > .container {
    display: flex;
    flex-direction: row;
}

.header > .container > h1 {
    line-height: 2;
    grid-column: 3;
    text-shadow: 2px 2px 4pxrgba(0, 0, 0, 1);
}
/* **********       End of CSS for header      ********** */


/* **********         CSS for sections         ********** */
section {
    min-height: 15vh;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-home);
    padding-top: 30px;
    padding-bottom: 30px;
    /* opacity: 0; */
}

.container {
    max-width: 70%;
    margin: 0 auto;
}
/* **********      End of CSS for sections     ********** */

/*       Additional styling for individual sections       */
#home {
    background-color: var(--background-first-section);
    color: var(--text-first-section);
}

#home > .container > div { 
    display: flex;
    flex-direction: column;
}

.job-title {
    font-size: 34px;
}

.job-title-desc {
    margin: 0;
}

#about {
    background-color: var(--background-second-section);
    color: var(--text-second-section);
}

#education {
    background-color: var(--background-first-section);
    color: var(--text-first-section);
}

/* **********      CSS for skills' section     ********** */
i {
    color: var(--text-first-section);
}

/* **********  End of CSS for skills' section  ********** */

/* **********      CSS for skills' section     ********** */
#skills {
    background-color: var(--background-second-section);
    /* color: var(--text-second-section); */
    padding-bottom: 60px;
}

#skills > .container {
    display: grid;
    grid-template-columns: 2fr 10fr 2fr;
}

#skills > .container > h2 {
    grid-column: 2;
}

.skills {
    grid-column: 2;
    display: grid;
    grid-template-columns: 10fr 1fr 10fr;
}

.skills p {
    width: 100%;
}

.card {
    width: 300px;
    height: 300px;
    perspective: 1000px; /* Perspective value for 3D transforms */
    position: relative;
    margin: 50px;
    right: 10px; /* Modifies position of elements with relative position */
    margin-bottom: 40px;
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: absolute;
}

.card:hover .card-inner {
    transform: rotateY(-180deg);
}

.card:nth-child(2n) { /* Apply changes to the right column, 
    by choosing only even children with class card */
    /* right: 50px; */
}

.card-front,
.card-back {
    background-image: linear-gradient(to bottom right,
    var(--background-card-begin),var(--background-card-end));
    padding: 30px;
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
}
  
.card-back {
    transform: rotateY(-180deg);
}

#skill1 {
    grid-column: 1;
}
#skill2 {
    grid-column: 3;
}
#skill3 {
    grid-column: 1;
}
#skill4 {
    grid-column: 3;
}
#skill5 {
    grid-column: 1;
}
#skill6 {
    grid-column: 3;
}
/* **********  End of CSS for skills' section  ********** */


/* **********     CSS for projects' section    ********** */
#projects {
    background-color: var(--background-first-section);
    color: var(--text-first-section);
}

#projects > .container > br {
    border: 3px solid;
}

.project {
    padding: 20px;
    border-top: 2px solid var(--text-home);
}

.project-desc {
    margin-bottom: 10px;
}
/* ********** End of CSS for projects' section ********** */


/* **********   CSS for experiences' section   ********** */
#experience {
    background-color: var(--background-second-section);
    color: var(--text-second-section);
}

.content {
    display: flex;
    flex-direction: row;
}

.ex-headline {
    display: grid;
    grid-template-columns: 8fr 4fr;
    margin: 10px 0;
}

.title {
    grid-column: 1;
    font-size: 22px;
    margin: 10px 0;
    text-align: left;
}

.language {
    grid-column: 2;
    text-align: right;
    vertical-align: middle;
    margin: 10px 0;
    line-height: 1.5;
}

.experience {
    padding: 20px;
}

.experience iframe {
    width: 150px;
    height: 150px;
}

.description-right, .description-left {
    margin: 0;
    text-align: left;
}

.description-right {
    padding-left: 25px;
}

.description-left {
    padding-right: 25px;
}
/* ********  End of CSS for experiences' section  ******** */

/* **********     CSS for minigames' section    ********** */
#minigames {
    background-color: var(--background-minigames);
    color: var(--text-minigames);
}

.games {
    display: grid;
    grid-template-columns: 1fr 4fr 4fr 1fr;
}

.left {
    grid-column: 2;
}

.right {
    grid-column: 3;
}
/* ********** End of CSS for minigames' section ********** */

/* **********    CSS for references' section    ********** */
#references {
    background-color: var(--background-first-section);
    color: var(--text-first-section);
}

.headline {
    display: flex;
    align-items: center;
    text-align: center;
}

.reference {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-top: 2px solid var(--text-home);
}
/* ********** End of CSS for references' section ********** */

/* **********    CSS for utilities' section    ********** */
#utilities {
    background-color: var(--background-first-section);
    color: var(--text-first-section);
}

.util {
    display: flex;
    flex-direction: column;
}

.util-content {
    display: grid;
    grid-template-columns: 5fr 8fr 5fr;
}

.source {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.source p, .result p {
    margin: 5px;
}

textarea[name="source"] {
    flex: 1 0 auto;
    resize: none;
}

.company-data {
    display: flex;
    flex-direction: column;
    text-align: left;
    grid-column: 2;
    padding: 0 15px;
}

.result {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
}

textarea[name="result"] {
    flex: 1 0 auto;
    resize: none;
}

button.download {
    background-color: var(--background-first-section);
    border: 0;
    font-size: medium;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.data-piece {
    margin: 5px;
}

input[name="insert"] {
    background-color: var(--background-button);
    font-weight: bold;
    color: var(--text-button);
    padding: 5px;
    font-size: large;
    margin-top: 10px;
    border: 2px solid var(--text-button);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

input[name="insert"]:hover {
    background-color: var(--background-button-hover);
}
/* ********   End of CSS for utilities' section  ******** */

/* **********     CSS for contacts' section    ********** */
#contact {
    display: block;
    background-image: linear-gradient(to bottom right, var(--background-footer-begin),var(--background-footer-end));
}

#contact > .container {
    display: grid;
    grid-template-columns: 4fr 1fr 4fr;
}

.contacts {
    grid-column: 1;
    text-align: left;
    align-items: flex-start;
}

.contacts > p {
    margin: 5px 0;
    text-align: left;
    width: 100%;
}
/* ********** End of CSS for contacts' section ********** */

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 1s forwards;
    opacity: 1;
}

.fade-out {
    animation: fadeOut 3s forwards;
    opacity: 0;
}

@media (max-width: 1000px) {
    .navbar > div > a {
        max-width: 70px;
        overflow: hidden;
    }
}

@media (max-width: 1200px) {
    .skills {
        display: flex;
        flex-direction: column;
    }

    #skills > .container {
        display: flex;
        flex-direction: column;
    }
}

/* Mobile view styling */
@media (max-width: 768px) {
    img[alt="Profile Picture"] {
        display: none;
    }
    
    h1 {
        text-align: center;
    }

    .navbar {
      position: fixed;
      z-index: 6;
    }

    .navbar-toggle {
      padding: 7.5px 15px;
      display: flex;
      flex-direction: column;
    }

    .navbar-links {
      display: none;
      flex-direction: column;
      width: 100%;
    }
  
    .navbar-links.drop {
      display: flex;
    }
  
    .navbar-links a {
      text-align: left;
      padding: 12px;
      border-top: 0px;
    }

    .navbar > div > a {
        max-width: none;
    }

    .header {
        margin-top: 50px;
        overflow: hidden;
        text-overflow: ellipsis;
    }


    .skills {
        display: flex;
        flex-direction: column;
    }

    .card {
        width: 90%;
        min-height: 300px;
        height: 100%;
        padding: 10px;
    }

    .card-front, .card-back {
        padding: 15px 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #skills > .container {
        display: flex;
        flex-direction: column;
    }

    .skills h3 {
        margin: 0;
    }

    .dev-section {
        margin-left: 0;
        margin-top: 20;
    }

    .card p {
        padding: 10px;
    }

    .is-flipped {
        transform: rotateY(180deg);
    }

    .experience iframe {
        width: 100px;
        height: 100px;
    }
  }