* {
    --image-1: url("img/code-logo.jpg");
    --image-2: url("img/css-logo.jpg");
    --image-3: url("img/db-logo.jpg");
    --image-4: url("img/html-logo.png");
    --image-5: url("img/js-logo.jpg");
    --image-6: url("img/www-logo.jpg");
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body{
    margin: 10px;
    /*background: linear-gradient(45deg,#232526,#414345) fixed no-repeat;*/
    background: linear-gradient(45deg,#9CECFB,#65C7F7,#0052D4) fixed no-repeat;
    overflow-x: hidden;
    overflow-y: scroll;
    padding: 20px;
    width: 100vw;
    height: 100vh;
    justify-content: space-around;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-family: 'Lora', serif;
    box-sizing: border-box;
}

.intro-mobile{
    text-align: left;
    font-size: large;
    line-height: 22px;
    color: rgb(95, 13, 202);
    font-weight: bold;
    white-space: pre-wrap;   /* Mimics the pre behavior but allows wrapping */
    word-wrap: break-word;
    margin: 10px;
    max-width: 100%;
    box-sizing: border-box;
}

.intro-desk{
    text-align: left;
    font-size: large;
    line-height: 22px;
    color: rgb(95, 13, 202);
    font-weight: bold;
    white-space: pre-wrap;   /* Mimics the pre behavior but allows wrapping */
    word-wrap: break-word;
    box-sizing: border-box;
    margin: 20px;
}

.head{
    text-align: left !important;
    color: rgb(226, 22, 117);
    white-space: pre-wrap;   /* Mimics the pre behavior but allows wrapping */
    word-wrap: break-word;   /* Prevents words from overflowing */
    font-weight: bold;
    font-size: xx-large;
    box-sizing: border-box;
    margin: 20px;
}

.cube-container-middle {
    width: 15em;
    height: 15em;
    text-align: center;
    perspective: 45em;
    align-items: center;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}

.cube-container-last {
    margin-left: 2%;
    width: 15em;
    height: 15em;
    text-align: center;
    perspective: 45em;
    align-items: center;
    margin: 80px;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}

.cube{
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition-duration: 2s;
    transform: rotateX(-15deg) rotateY(20deg);
}   

.cube-side {
    position: absolute; 
    width: 100%;
    height: 100%;
    background-color: white;
    border: 1px solid rgb(255, 255, 255);
    background-position: center;
    background-size: cover;
    border-radius: 5px;
}

.cube-side:nth-child(1){
    transform: rotateY(0deg) translateZ(7.5em);
    background-image: var(--image-1);
}

.cube-side:nth-child(2){
    transform: rotateY(90deg) translateZ(7.5em);
    background-image: var(--image-2);
}

.cube-side:nth-child(3){
    transform: rotateY(180deg) translateZ(7.5em);
    background-image: var(--image-3);
}

.cube-side:nth-child(4){
    transform: rotateY(-90deg) translateZ(7.5em);
    background-image: var(--image-4);
}

.cube-side:nth-child(5){
    transform: rotateX(-90deg) translateZ(7.5em);
    background-image: var(--image-5);
}

.cube-side:nth-child(6){
    transform: rotateX(90deg) translateZ(7.5em);
    background-image: var(--image-6);
}

.radio-button {
    margin-bottom: 5em;
}

.radio-button:checked ~ .cube {
    transition-duration: 3s;
    transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}
    
.radio-button:nth-child(1):checked ~ .cube {
    transform: rotateX(-15deg) rotateY(20deg);
}
    
.radio-button:nth-child(2):checked ~ .cube {
    transform: rotateX(-15deg) rotateY(180deg);
}
    
.radio-button:nth-child(3):checked ~ .cube {
    transform: rotateX(-15deg) rotateY(90deg);
}
    
.radio-button:nth-child(4):checked ~ .cube {
    transform: rotateX(-15deg) rotateY(-90deg);
}
    
.radio-button:nth-child(5):checked ~ .cube {
    transform: rotateX(-105deg) rotateY(0deg);
}
    
.radio-button:nth-child(6):checked ~ .cube {
    transform: rotateX(75deg) rotateY(0deg);
}

@keyframes cubeAnimation {
    0%, 100% {
      transform: rotateX(-15deg) rotateY(20deg);
    }
    16.67% {
      transform: rotateX(-15deg) rotateY(180deg);
    }
    33.33% {
      transform: rotateX(-15deg) rotateY(90deg);
    }
    50% {
      transform: rotateX(-15deg) rotateY(-90deg);
    }
    66.67% {
      transform: rotateX(-105deg) rotateY(0deg);
    }
    83.33% {
      transform: rotateX(75deg) rotateY(0deg);
    }
}
  
.cube {
  animation: cubeAnimation 15s infinite;
}

.radio-button:checked ~ .cube {
  animation-play-state: running;
}

[name=slider] {
    display: flow-root;  
}

.gallery{
    margin: 100px;
    width: 100%;
}

.gallery-container{
    align-items: center;
    display: flex;
    height: 600px;
    margin: 0 auto;
    max-width: 1000px;
    position: relative;
}

.gallery-item{
    height: 400px;
    opacity: 0;
    position: absolute;
    transition: all 0.3s ease-in-out;
    width: 330px;
    z-index: 0;
    border-radius: 15px;
    background-size: contain;
}

.gallery-item-1{
    left: 15%;
    opacity: .4;
    transform: translateX(-50%);
}

.gallery-item-2, .gallery-item-4{
    height: 450px;
    opacity: 0.8;
    width: 380px;
    z-index: 1;
}

.gallery-item-2{
    left: 30%;
    transform: translateX(-50%);
}

.gallery-item-3{
    box-shadow: -2px 5px 33px 6px rgba(0,0,0,0.35);
    height: 550px;
    opacity: 1;
    left: 50%;
    transform: translateX(-50%);
    width: 430px;
    z-index: 2;
}

.gallery-item-4{
    left: 70%;
    transform: translateX(-50%);
}

.gallery-item-5{
    left: 85%;
    opacity: .4;
    transform: translateX(-50%);
}

.gallery-controls{
    display: flex;
    justify-content: center;
    margin: 25px 0;
    height: 100px;
}

.gallery-controls button{
    background-color: transparent;
    border: 0;
    cursor: pointer;
    font-size: 30px;
    margin: 0 50px;
    padding: 0 12px;
    text-transform: capitalize;
}

.gallery-controls button{
    outline: none;  
}

.gallery-controls-previous{
    position: relative;
}

.gallery-controls-previous::before{
    border: solid #000;
    border-width: 0 5px 5px 0;
    content: '';
    display: inline-block;
    height: 5px;
    left: -30px;
    padding: 10px;
    position: absolute;
    top: 25%;
    transform: rotate(135deg) translateY(-50%);
    transition: left 0.15s ease-in-out;
    width: 5px;
}

.gallery-controls-previous:hover::before{
    left: -40px;
}

.gallery-controls-next{
    position: relative;
}

.gallery-controls-next::before{
    border: solid #000;
    border-width: 0 5px 5px 0;
    content: '';
    display: inline-block;
    height: 5px;
    padding: 10px;
    position: absolute;
    right: -30px;
    top: 45;
    transform: rotate(-45deg) translateY(-50%);
    transition: right 0.15s ease-in-out;
    width: 5px;
}

.gallery-controls-next:hover:before{
    right: -40px;
}

.gallery-nav{
    bottom: -15px;
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    position: absolute;
    width: 100%;
}

.gallery nav li{
    background: #ccc;
    border-radius: 50%;
    height: 10px;
    margin: 0 16px;
    width: 10px;
}

.gallery-nav li.gallery-item-selected{
    background: #555;
}

#contact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px;
    width: 80vw;
    margin-right: 40px;
}
  
#contact h1 {
    flex: 1;
    font-size: 30px;
    color: rgb(226, 22, 117);
    font-weight: bold;
    text-align: center;
    align-items: center;
}

.column {
    width: 48%;
}
  
form {
    flex: 2; /* Allow the form to take up more space */
    display: flex;
    flex-direction: column;
    width: 100%;
    font-size: 15px;
    font-weight: bolder;
    margin: 10px 0;
    padding: 10px;
}
  
  label {
    margin-bottom: 5px;
    color: #d6440b;
  }
  
  input, textarea {
    margin-bottom: 15px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  button {
    padding: 10px 15px;
    font-size: 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  button:hover {
    background-color: #0056b3;
  }
  
  .mail {
    font-size: 15px;
    font-weight: bold;
    color: rgb(226, 22, 117);
    text-decoration: none;
    text-align: center;
    display: block;
    margin: 5px auto;
  }

  .mail:hover {
    color: rgb(95, 13, 202);
  }

  .contact-icons a {
    color: #0077b5;
    font-size: 24px;
    margin-right: 10px;
    text-decoration: none;
    text-align: center;
    display: block;
    margin: 5px auto;
}

.contact-icons a:hover {
    color: #005582;
}

/* Center the contact form elements for smaller screens */
@media (max-width: 768px) {
    .contact {
        flex-direction: column;
        align-items: center;  /* Center content */
        padding: 20px;
    }

    .column {
        width: 80%;  /* Make form elements use more width */
        align-items: center;
    }

    .mail {
        display: block;
        margin: 20px auto;
        align-items: center;
        margin: auto;
    }

    .main {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.4;
        display: flex;
        flex-direction: column;
        align-items: center; /* Center align name and intro */
    }

    .intro-mobile {
        max-width: 100%;
        padding: 10px;
    }

    .intro-desk {
        display: none;
    }

    .head {
        max-width: 100%;
        padding: 0;
        margin: 10px;
    }
    
      .cube-container-middle {
        display: block;  /* Show the middle cube */
        margin: 30px;
      }
    
      .cube-container-last {
        display: none;  /* Hide the last cube */
      }
}

@media (max-width: 480px) {
    .contact {
        padding: 15px;
    }

    .column {
        width: 100%;
    }

    form input, form textarea {
        padding: 8px;
    }

    .main {
        max-width: 100%;
        font-size: 0.5rem;
    }

    .intro-mobile {
        max-width: 100%;
        padding: 10px;
    }

    .intro-desk {
        display: none;
    }

    .head {
        max-width: 100%;
        padding: 0;
        margin: 10px;
    }
    
      .cube-container-middle {
        display: block;  /* Show the middle cube */
        margin: 30px;
      }
    
      .cube-container-last {
        display: none;  /* Hide the last cube */
      }
}

/* For Desktop */
@media (min-width: 769px) {

    .intro-mobile {
        display: none;
        max-width: 100%;
    }

      .cube-container-last {
        margin-left: 2%;
        width: 15em;
        height: 15em;
        text-align: center;
        perspective: 45em;
        align-items: center;
        margin: 80px;
      }

      .cube-container-middle {
        display: none;
      }
      
  }