/* Variables */
:root {
  --primary-color: #009999;
  --accent-color: #00b3b3;
  --bg-color: #222222;
  --content-bg: #2e2e2e;
  --text-color: #f5f5f5;
  --text-secondary: #cccccc;
}

/* Base Styles */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  font-family: 'Montserrat', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
  border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-color);
}

.hidden {
  display: none !important;
}

/* Buttons */
button, .btn-primary, .see-more-button, .btn-large {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  border-radius: 4px;
  transition: background 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover, .btn-primary:hover, .see-more-button:hover, .btn-large:hover {
  background-color: var(--accent-color);
}

.see-more-container {
  text-align: center;
  margin: 2rem 0;
}

.see-more-button {
  padding: 0.8rem 2rem;
  font-weight: 600;
  font-size: 1.1rem;
  background-color: #333;
  width: 100%;
  max-width: 240px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}

.btn-large {
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 1px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  position: sticky;
  top: 0;
  background-color: var(--content-bg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(to right, rgba(128,128,128,0), rgba(128,128,128,0.75) 50%, rgba(128,128,128,0)) 1;
}

header h2 {
  margin: 0;
  color: var(--text-color);
  font-weight: 600;
  font-size: 20px;
  text-align: right;
  padding-right: 20px;
}

header nav {
  display: flex;
  gap: 40px;
  padding: 0 20px;
  justify-content: flex-start;
}

header nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 18px;
  transition: all 0.3s ease;
}

header nav a:hover,
header nav a.active {
  color: var(--accent-color);
  transform: scale(1.1);
}

header nav a.active {
  border-bottom: 2px solid var(--accent-color);
}

/* Layout Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  background-color: var(--content-bg);
  color: var(--text-color);
  margin: 20px auto;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* Home Page Sections */
.about-me {
  text-align: left;
  margin-bottom: 40px;
}

.about-me h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.about-me p {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.about-text-container {
   max-width: 800px; 
   line-height: 1.6; 
}

.about-text-container p {
   margin-bottom: 20px; 
}

/* Skills */
.skills-overview {
  background-color: var(--content-bg);
  padding: 40px;
  margin-top: 40px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.skills-category {
  flex: 1 1 45%;
  background-color: #333;
  border-radius: 8px;
  padding: 20px;
}

.skills-category h3 {
  color: var(--accent-color);
  margin-bottom: 10px;
}

.skills-category ul {
  list-style: none;
  padding: 0;
}

.skills-category li {
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.skill-item {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--accent-color);
}

.skill-item::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-color);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.8em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 10;
}

.skill-item:hover::after {
  opacity: 1;
}

/* Cards (General) */
.card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  cursor: pointer;
}

.card img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}

.card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  overflow: hidden;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: height 0.3s ease, padding-bottom 0.3s ease;
}

.card .overlay h3,
.card .overlay p {
  opacity: 0;
  transition: opacity 0.15s ease;
  margin: 0;
}

.card .overlay h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.card:hover img {
  transform: scale(1.05);
}

.card:hover .overlay {
  height: 100%;
  padding-bottom: 10px;
}

.card:hover .overlay h3,
.card:hover .overlay p {
  opacity: 1;
}

.portfolio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Portfolio Page Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.portfolio-card.type2 {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--content-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid transparent;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.portfolio-card.type2:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.portfolio-image.type2-image {
  width: 100%;
  height: 200px;
  display: block;
  object-fit: cover;
}

.description-container.type2-container {
  padding: 1rem;
  background-color: var(--bg-color);
  flex-grow: 1;
}

.portfolio-header.type2-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.portfolio-title.type2-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-color);
}

.portfolio-info.type2-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.portfolio-description.type2-description {
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.4;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 0;
}

.modal-content {
  background-color: var(--content-bg);
  border-radius: 8px;
  padding: 30px;
  padding-top: 15px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  box-sizing: border-box;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}

#modal-title {
  grid-column: 1 / -1;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 2rem;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

#modal-description {
  grid-column: 1 / -1;
  color: var(--text-color);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent-color);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close::before, .modal-close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: background-color 0.3s;
}

.modal-close::before { transform: rotate(45deg); }
.modal-close::after { transform: rotate(-45deg); }
.modal-close:hover { background: var(--primary-color); transform: rotate(90deg); }

/* Modal Slideshow */
.modal-slideshow {
  grid-column: 2;
  position: relative;
  height: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.modal-slide-container {
  width: 100%;
  flex-grow: 1;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  margin: 0;
  border-radius: 8px;
}

.modal-slide-container img,
.modal-slide-container video {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: top;
  border-radius: 8px;
  display: block;
}

.slide-btn {
  position: absolute;
  width: 36px;
  height: 36px;
  background: rgba(0, 179, 179, 0.3);
  border: 1px solid var(--accent-color);
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(2px);
}

#prevSlide { left: 20px; }
#nextSlide { right: 20px; }
.slide-btn:hover { background: rgba(255, 255, 255, 0.4); transform: scale(1.1); }

.slideshow-navigation {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 5;
  padding: 0 60px;
}

.thumbnail-container {
  display: flex;
  gap: 8px;
  max-width: calc(100% - 120px);
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
}

.slide-thumbnail {
  width: 60px;
  height: 40px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s ease;
  object-fit: cover;
  flex-shrink: 0;
}

.slide-thumbnail:hover, .slide-thumbnail.active { opacity: 1; border-color: var(--accent-color); }
.slide-thumbnail.active { transform: scale(1.05); }

/* Modal Details (Left Column) */
#description-container {
  grid-column: 1;
  align-self: start;
  margin-top: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
  text-align: left;
  border-left: 2px solid var(--primary-color);
  padding-left: 15px;
  margin-left: 10px;
}

.info-box-container {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 0;
}

.info-box {
  background: linear-gradient(135deg, rgba(0,153,153,0.1) 0%, rgba(0,153,153,0.05) 100%);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(0,179,179,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 120px;
}

.info-box:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,179,179,0.2); }

.info-box-title {
  font-size: 1rem;
  color: var(--accent-color);
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.info-box-text {
  font-size: 1.1rem;
  color: var(--text-color);
  font-weight: 500;
}

.project-details {
  grid-column: 1 / -1;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,179,179,0.3);
  white-space: pre-wrap;
}

.project-details h3 {
  color: var(--accent-color);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.project-details ul { padding-left: 20px; margin-bottom: 25px; }
.project-details li { margin-bottom: 8px; position: relative; color: var(--text-color); }
.project-details li:before { content: "▹"; position: absolute; left: -20px; color: var(--primary-color); }

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-tags span {
  background: rgba(0,153,153,0.2);
  color: var(--text-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(0,179,179,0.3);
}

#all-images-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 100%;
  padding: 1rem 0;
}

.image-with-description img, .image-with-description video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  display: block;
}

/* Contact & Resume */
.contact-intro {
   max-width: 800px;
   margin-bottom: 40px;
   font-size: 1.1rem;
   color: var(--text-color);
   line-height: 1.6;
}

.contact-methods-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 20px;
   margin-bottom: 50px;
}

.contact-card {
   background-color: var(--bg-color);
   padding: 25px;
   border-radius: 8px;
   text-decoration: none;
   transition: transform 0.3s ease, border-color 0.3s ease;
   border: 2px solid transparent;
   box-shadow: 0 4px 6px rgba(0,0,0,0.2);
   display: flex;
   flex-direction: column;
   justify-content: center;
}

a.contact-card:hover {
   transform: translateY(-5px);
   border-color: var(--primary-color);
   cursor: pointer;
}

.contact-card h3 {
   font-size: 1rem;
   color: var(--accent-color);
   margin: 0 0 10px 0;
}

.contact-card p {
   color: var(--text-color);
   margin: 0;
   font-size: 1rem;
   font-weight: 500;
}

.resume-section {
   text-align: center;
   padding: 40px;
   background-color: rgba(0, 153, 153, 0.1);
   border-radius: 8px;
   border: 1px solid rgba(0, 153, 153, 0.2);
}

.resume-section h3 {
   margin-top: 0;
   margin-bottom: 20px;
   color: var(--text-color);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 0 60px;
  margin-top: 80px;
  color: var(--text-color);
  background-color: transparent;
}

.footer-divider {
  height: 2px;
  width: 100%;
  max-width: 200px;
  margin: 0 auto 30px auto;
  background-color: var(--primary-color);
  opacity: 0.6;
}

.footer-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.footer-role {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 25px;
  font-weight: 400;
}

.footer-nav {
  margin-bottom: 20px;
}

.footer-nav a {
  display: inline-block;
  margin: 0 15px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--accent-color);
}

.footer-contact-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  opacity: 0.8;
}

.footer-contact-info .dot {
  margin: 0 10px;
  color: var(--primary-color);
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 30px;
  opacity: 0.5;
}

/* Mobile Media Queries */
@media screen and (max-width: 768px) {
    /* Header Stack */
    header {
        flex-direction: column-reverse;
        align-items: center;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }

    header nav {
        width: 100%;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    header nav a {
        margin-left: 0;
        font-size: 14px;
        padding: 5px;
    }

    header h2 {
        margin: 0;
        font-size: 1.5rem;
        text-align: center;
    }

    /* Portfolio Cards Stack */
    .portfolio-grid, 
    #portfolio-container { 
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 30px;
        padding: 0 10px;
    }

    .portfolio-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .portfolio-card img {
        height: 200px;
        object-fit: cover;
        width: 100%;
    }
}

@media (max-width: 600px) {
  /* Footer Stack */
  .footer-nav a {
    display: block;
    margin: 10px 0;
  }

  /* Modal Mobile Layout */
  .modal-content {
    grid-template-columns: 1fr;
    width: 95%;
    padding: 20px;
    padding-top: 50px;
  }
  
  .info-box-container,
  .modal-slideshow,
  #description-container {
    grid-column: 1;
  }
  
  .modal-slideshow {
    height: 300px;
    margin-top: 20px;
  }
  
  .info-box-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .info-box-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-slideshow {
    height: 250px;
  }
}