/* ==========================================================================
   Global Styles & Variables
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap");

:root {
    --primary-color: #7cdfaf;
    --secondary-color: #a0d1e8;
    --tertiary-color: #edead0;
    --accent-color: #ffcf56;
    --text-color: #333;
    --font-family: "Roboto", "Arial", sans-serif;
    --bg-color: #e8f3f0;
    --border-radius: 8px;
    --container-bg: #ffffff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --active-color: #3ab795;
    --hover-color: #86baa1;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem; 
    font-family: var(--font-family);
    overflow-x: hidden;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}
/* ==========================================================================
   Main Layout
   ========================================================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--accent-color);
  z-index: 900;
  padding: 14px 0;
  border-radius: 0px 0px 45px 0px;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
}

header .container {
  display: flex;
  justify-content: space-between; 
  align-items: center;
  padding: 0 60px 0 30px;
}

main {
    padding: 80px 40px 30px 100px;
}

main .container {
    background-color: var(--container-bg);
    padding: 40px;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

footer {
    padding: 20px;
    text-align: center;
    background-color: var(--accent-color);
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    color: var(--text-color);
}

footer p {
    margin: 0;
    font-weight: 500;
}

/* ==========================================================================
    Components
   ========================================================================== */

/* --- Logo --- */
.logo {
  font-size: 1.375rem;
  font-weight: bold;
  color: var(--text-color);
  background-color: var(--container-bg);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  padding: 20px;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  border: 2px solid var(--text-color);
  margin: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.logo:hover {
  transform: scale(1.05) rotate(-5deg);
  box-shadow: rgba(0, 0, 0, 0.09) 0px 2px 1px, rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px, rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0, 0, 0.09) 0px 32px 16px;
  cursor: no-drop;
}

/* --- Dark Mode Switch --- */
.dark-mode-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dark-mode-container ion-icon {
  font-size: 1.5rem; 
  color: var(--text-color);
}

/* Dark Mode Toggle Switch */
.dark-mode-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  align-self: center;
  
}

.dark-mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--active-color);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* --- Navigation Menu --- */
.menu {
  position: fixed;
  width: 60px;
  padding: 12px 8px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: width 0.4s ease; 
  border-radius: 30px;
  z-index: 999;
  transform: translateY(-50%);
  background-color: #ffcf56e8;
  left: 0;
  top: 50%;
  overflow: hidden; 
  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
}

.menu:hover {
  width: 160px;
  align-items: flex-start; 
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: flex-start; 
  padding: 8px 7px; 
  border-radius: 25px; 
  color: var(--text-color);
  font-size: 1.5rem;
  width: 100%; 
  transition: background-color 0.3s;
}

.menu-link.active {
  background-color: var(--active-color);
}
.menu-link:hover {
  background-color: var(--hover-color);
}

.menu-link.active,
.menu-link:hover {
  color: white;
}

.menu-link ion-icon {
  font-size: 1.875rem;
  min-width: 30px;
}

.menu-label {
  font-size: 1rem; 
  font-weight: 500;
  white-space: nowrap; 
  overflow: hidden;
  margin-left: 0;
  max-width: 0;
  opacity: 0;
  transition: opacity 0.2s ease, max-width 0.3s ease 0.1s, margin-left 0.3s ease 0.1s;
}


.menu:hover .menu-label {
  opacity: 1;
  max-width: 84px;
  margin-left: 16px;
}
/* --- Timeline (Education) --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 20px auto 0;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  height: 100%;
  width: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.timeline-item {
  padding: 10px 0 20px 60px;
  position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 15px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: white;
  border: 4px solid var(--primary-color);
  z-index: 1;
}

.timeline-content {
  background-color: var(--bg-color);
  padding: 20px;
  border-radius: var(--border-radius);
  position: relative;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-item.is-visible .timeline-content {
  opacity: 1;
  transform: translateX(0);
}

.timeline-content h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--active-color);
  margin: 0 0 10px 0;
}

.timeline-content p {
    margin: 0;
    padding: 0;
    text-align: left;
    max-width: 100%;
    line-height: 1.5;
    font-size: 1.2rem;
}

.timeline-date {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 8px;
  background-color: var(--accent-color);
  color: var(--text-color);
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
}

.timeline-content a {
  color: #0392df;
  font-weight: bold;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

.timeline-content a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: #044b71;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.timeline-content a:hover {
  color: #044b71;
}

.timeline-content a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
  background-color: #044b71;
}

/* --- Carousel (Portfolio) --- */
.carousel-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.projects-wrapper {
  overflow: hidden;
  width: 100%;
}

.projects {
  display: flex;
  gap: 20px;
  padding: 10px;
  scroll-behavior: smooth;
  -ms-overflow-style: none;  
  scrollbar-width: none;  
  margin: 0;
  padding-left: 0;
}

.projects::-webkit-scrollbar {
  display: none 
}

.project-card {
  flex: 0 0 340px; 
  background-color: var(--container-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s ease;
  border: 1px solid #ddd;
  color: var(--text-color);
  text-decoration: none;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.project-card .project-info {
  padding: 15px;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

.project-card p {
    font-size: 0.9375rem; 
    line-height: 1.5;
    text-align: center;
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.carousel-button {
  background-color: var(--accent-color);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  box-shadow: var(--shadow);
  transition: background-color 0.3s;
  font-size: 1.5rem; 
  flex-shrink: 0;
}

.carousel-button:hover {
    background-color: var(--hover-color);
    color: white;
}

.carousel-button.prev {
  margin-right: 15px;
}

.carousel-button.next {
  margin-left: 15px;
}

/* --- Contact Form --- */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#contact-form label {
  font-weight: bold;
}

#contact-form input,
#contact-form textarea {
  padding: 15px 20px;
  border: 2px solid transparent;
  border-radius: 15px;
  font-size: 1rem; 
  background-color: #f0f4f8;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  color: #333;
}

#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--active-color);
  box-shadow: 0 0 0 3px rgba(58, 183, 149, 0.3);
}

#contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

#contact-form button {
  padding: 18px 12px;
  background-color: var(--active-color);
  margin-top: 8px;
  color: white;
  border: none;
  border-radius: 15px;
  cursor: pointer; 
  font-size: 1rem;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.3s ease;
}

#contact-form button:hover {
  background-color: #333333;
  transform: translateY(-2px);
}

/* ==========================================================================
   Section-Specific Styles & Overrides
   ========================================================================== */

/* --- General Section Styling --- */
main .container p {
    max-width: 80ch;
    color: var(--text-color);
    margin: 0 auto 20px auto; 
    font-size: 1rem; 
    line-height: 1.6;
}

main .container ul {
    list-style-position: inside;
    padding-left: 20px;
    max-width: 80ch;
    margin: 0 auto;
}

main .container li {
    margin-bottom: 10px;
    line-height: 1.6;
}

main .container h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--active-color);
    font-weight: 700;
    text-transform: uppercase;
}

#education,
#portfolio,
#contact {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 40px;
}

/* --- About Section --- */
#about-me {
    display: flex;
    align-items: stretch; 
    gap: 40px;
    padding-top: 60px;
    min-height: 87vh;
}

#about-me .about-me-content {
    flex: 1;
    background-color: var(--primary-color);
    color: #2c3e50; 
    border-radius: 35px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
    border: 1.8px solid #08080875;
}

#about-me h2 {
    text-align: left;
    font-weight: 700;
    color: #544747;
    font-size: 1.8em;
}

#about-me p {
    font-size: 1.3125rem; 
    line-height: 1.6;
    padding-top: 12px;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

#about-me .btn-container {
    display: flex;
    gap: 15px;
    margin: 15px 0 30px 0;
}

#about-me .btn {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #333;
    background-color: var(--accent-color);
    color: var(--text-color); 
}

#about-me .btn:hover {
    background-color: transparent;
    transform: scale(1.05);
}

#about-me .btn.btn-secondary {
    background-color: #ffffff;
    color: #333;
    border: 2px solid #333;
}

#about-me .btn.btn-secondary:hover {
    transform: scale(1.05);
}

#about-me .social-links {
    display: flex;
    gap: 20px;
}

#about-me .social-links ion-icon {
    font-size: 2.25rem; 
    color: #0077B5;  
}

#about-me .social-links a:last-child ion-icon {
    color: rgb(35, 35, 35);  
}

#about-me .social-links a:hover ion-icon {
    transform: scale(1.1);
}

#about-me .about-me-image {
    flex: 1;
    position: relative;
    background-color: var(--accent-color);
    border-radius: 45px;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0,0, 0.2) 0px -3px 0px inset;
    border: 1.8px solid #21212175;
}

#about-me img {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;  
    margin: 0 auto;
    height: 115%;
}

/* ==========================================================================
   Animations
   ========================================================================== */

.hidden-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.show-section {
    opacity: 1;
    transform: translateY(0);
}

.animate-from-left,
.animate-from-right {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-from-left {
    transform: translateX(-50px);
}

.animate-from-right {
    transform: translateX(50px);
}

.animate-from-left.is-visible,
.animate-from-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}
/* ==========================================================================
   Media Queries (Responsiveness)
   ========================================================================== */

@media (max-width: 1320px) {
  .menu {
    width: 100%;
    height: 60px;
    padding: 0;
    margin: 0;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    border-radius: 15px 15px 0 0;
    background-color: var(--accent-color);
    left: 0;
    top: auto;
    bottom: 0;
    transform: none;
    border-radius: 0px;
    transition: none;
  }

  .menu:hover {
    width: 100%;
    align-items: center;
  }

  .menu-link {
    position: relative;
    padding-top: 8px;
    border-radius: 0;
    background-color: transparent;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px;
    font-size: 1.25rem;
    transition: none;
  }


  .menu-link:hover {
    background-color: transparent;
    color: var(--text-color);
  }
  .menu-link.active {
    background-color: transparent;
    color: rgb(4, 3, 3);
  }

  .menu-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: var(--active-color);
    border-radius: 2px;
  }

  .menu-link span {
    animation: none;
    transform: none;
  }

  .menu:hover .menu-label {
    margin-left: 0;
  }

  .menu-label {
    opacity: 1;
    max-width: 100px;
    margin-left: 0;
    font-size: 0.75rem; 
    transform: none;
    transition: none;
  }

  main {
    padding: 100px 80px 80px 80px;
  }

  #about-me {
    flex-direction: column;
    padding-top: 28px;
  }

  #about-me p {
    font-size: 1.1875rem; 
  }

  #about-me .about-me-image {
    position: relative;
    background-color: var(--accent-color);
    box-shadow: var(--shadow);
    min-height: 420px; 
    margin-top: 40px; 
  }

  #about-me img {
    position: absolute;
    height: 115%;
    width: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
  }

  /* 
    Disable hover effects on smaller screens for better usability
  */
  .logo:hover,
  .project-card:hover,
  #about-me .social-links a:hover ion-icon {
    transform: none;
  }

  .carousel-button:hover {
    background-color: var(--accent-color);
    color: var(--text-color);
  }

  #contact-form button:hover {
    background-color: var(--active-color);
  }

  #about-me .btn:hover {
    transform: none;
    background-color: var(--accent-color);
  }

  #about-me .btn.btn-secondary:hover {
    background-color: #ffffff;
  }

  footer {
    background-color: #272626;
    color: #f0f0f0;
  }
}

@media (max-width: 868px) {
  main {
    padding: 100px 20px 80px 20px;
  }

  #about-me p {
    font-size: 1rem;
  }

  #about-me .about-me-image {
    min-height: 350px; 
    margin-top: 20px;
  }

  #portfolio .projects-wrapper {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .carousel-button {
    display: none;
  }
  
  #portfolio .project-card {
    flex-basis: 90%; 
    flex: 0 0 60%;
    max-width: 80%;
  }

  #contact-form {
    padding: 40px 0; 
  }

  #contact-form input,
  #contact-form textarea {
    min-width: 0; 
    width: 100%;
  }

  footer {
    margin-bottom: 60px; 
  }
}

@media (max-width: 600px) {
  #portfolio .project-card {
    flex: 0 0 95%;
    max-width: 95%;
  }
}

@media (max-width: 470px) {
  main {
    padding-left: 0;
    padding-right: 0;
  }

  header .container {
    padding: 0 20px;
  }

  #about-me .about-me-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  main .container {
    border-radius: 0;
    padding: 30px 20px;
    width: 100%;
    box-shadow: none;
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
  }

  main .container:last-of-type {
    margin-bottom: 0;
    border-bottom: none;
  }

  main .container h2 {
    font-size: 1.8rem;
  }

  #about-me h2 {
    font-size: 1.6rem;
  }

  #about-me .btn-container {
    flex-direction: column;
    align-items: stretch;
  }

  #portfolio {
    padding-left: 0;
    padding-right: 0px;
  }

  #education {
    padding-left: 20px;
    padding-right: 20px;
  }

  #contact-form input,
  #contact-form textarea {
    font-size: 1rem;
    width: 100%; 
  }
}