/* Portfolio Page Styles - Dark Vibe Theme */
:root {
  --bg-color: #050505;
  --card-bg: #111;
  --text-color: #fff;
  --text-secondary: #aaa;
  --accent-color: #ff6400;
  --border-color: rgba(255, 255, 255, 0.1);
  --font-family: 'Outfit', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  /* Prevent side scroll bars */
}

/* Header */
.header {
  text-align: center;
  padding: 100px 20px 60px;
  position: relative;
  overflow: hidden;
}

/* Expert Glow Effect */
.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 100, 0, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.header__title {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 15px;
  color: #fff;
  letter-spacing: -1px;
}

.header__subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Filter Navigation - Expert Glass Design */
.filter {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 50px;
  position: relative;
  z-index: 10;
}

.filter__btn {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #aaa;
  padding: 12px 30px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.filter__btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
}

.filter__btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(255, 100, 0, 0.5);
  transform: translateY(-2px) scale(1.05);
}

/* Portfolio Grid - Pinterest/Masonry Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.portfolio {
  column-count: 2;
  /* Mobile 2 columns */
  column-gap: 15px;
  padding-bottom: 40px;
}

@media (max-width: 480px) {
  .portfolio {
    column-count: 2;
  }
}

@media (min-width: 600px) {
  .portfolio {
    column-count: 2;
  }
}

@media (min-width: 900px) {
  .portfolio {
    column-count: 3;
  }
}

@media (min-width: 1200px) {
  .portfolio {
    column-count: 4;
  }
}

.portfolio-item {
  position: relative;
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
  /* Masonry specific */
  break-inside: avoid;
  margin-bottom: 20px;
  /* Gap between items interactively */
  /* Initial state for animation */
  opacity: 0;
  transform: translateY(20px);
  /* Reduced offset */
}

/* Animation State */
.portfolio-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ensure hidden items are truly gone */
.portfolio-item.hidden {
  display: none;
}

/* Neon Glow Effect */
.portfolio-item::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--accent-color), #fff, var(--accent-color));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: blur(10px);
}

.portfolio-item:hover::before {
  opacity: 1;
  animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}

.portfolio-item::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--card-bg);
  /* Inner card bg */
  border-radius: 19px;
  z-index: -1;
}

.portfolio-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.portfolio-item__image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease, opacity 0.3s;
}

/* Removed forced heights for true random masonry */

.portfolio-item:hover .portfolio-item__image {
  transform: scale(1.1);
  opacity: 0.5;
  /* Darken for text */
}

/* Overlay Info */
.portfolio-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.portfolio-item:hover .portfolio-item__overlay {
  opacity: 1;
}

.portfolio-item__title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 5px;
  margin-bottom: 5px;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.portfolio-item:hover .portfolio-item__title {
  transform: translateY(0);
}

.portfolio-item__category {
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  font-size: 0.9rem;
  transform: translateY(20px);
  transition: transform 0.2s ease 0.05s;
}

.portfolio-item:hover .portfolio-item__category {
  transform: translateY(0);
}

/* Multi Image Indicator */
.portfolio-item__multi-indicator {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  backdrop-filter: blur(5px);
  color: #fff;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

/* Modal Container - Premium Glass Redesign */
.modal__container {
  background: rgba(10, 10, 10, 0.95);
  /* Deep dark glass */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 95%;
  max-width: 1400px;
  height: 85vh;
  /* Floating Card Style */
  border-radius: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateY(50px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

@media (min-width: 900px) {
  .modal__container {
    flex-direction: row;
  }
}

.modal.active .modal__container {
  transform: translateY(0);
  opacity: 1;
}

.modal__image-container {
  flex: 1.8;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Cinematic Shadow Inset */
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

/* Blurred Background Layer */
.modal__image-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(30px) brightness(0.4);
  opacity: 0.6;
  z-index: 0;
  transform: scale(1.1);
  /* Prevent blur edges */
}

.modal__image {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  position: relative;
  z-index: 1;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.modal__details {
  flex: 1;
  padding: 50px;
  background: #111;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.modal__title {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #fff;
  line-height: 1.2;
}

.modal__category {
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: inline-block;
}

.modal__description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal__close {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal__close:hover {
  background: var(--accent-color);
}

/* Hidden Utility */
.hidden {
  display: none;
}

/* Modal Carousel Styles */
.modal__carousel {
  position: relative;
  width: 100%;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.modal__carousel-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.modal__carousel-images {
  display: flex;
  transition: transform 0.3s ease-in-out;
  /* Support native scrolling if JS disabled or for touch */
  scrollbar-width: none;
  /* Firefox */
}

.modal__carousel-images::-webkit-scrollbar {
  display: none;
}

.modal__carousel-image {
  min-width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 60vh;
  display: block;
  user-select: none;
}

/* Navigation Buttons */
.modal__carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal__carousel-nav:hover {
  background: var(--accent-color);
  color: black;
}

.modal__carousel-prev {
  left: 10px;
}

.modal__carousel-next {
  right: 10px;
}

/* Indicators/Dots */
.modal__carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.modal__carousel-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.modal__carousel-indicator.active {
  background: var(--accent-color);
  transform: scale(1.2);
}

/* Footer Styles */
footer {
  background-color: #000;
  padding: 80px 0 30px;
  border-top: 1px solid var(--border-color);
  margin-top: 50px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-logo {
  max-width: 150px;
  margin-bottom: 20px;
}

.footer-col h4 {
  color: #fff;
  margin-bottom: 25px;
  font-size: 1.2rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a {
  color: #999;
  text-decoration: none;
  transition: 0.3s;
}

.footer-col ul li a:hover {
  color: var(--accent-color);
  padding-left: 5px;
}

.footer-col p {
  color: #999;
  margin-bottom: 12px;
  line-height: 1.6;
}

.social-links-footer {
  display: flex;
  gap: 15px;
}

.social-links-footer a {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s;
  font-size: 1.2rem;
}

.social-links-footer a:hover {
  background: var(--accent-color);
  color: #000;
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #666;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* =========================================
   Premium UI: Magnetic Cursor
   ========================================= */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  .cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s, transform 0.1s;
    mix-blend-mode: difference;
  }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
  }

  /* Hover State */
  .cursor-follower.hovered {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
    backdrop-filter: blur(2px);
  }

  /* Ensure pointer is hidden on clickable items too */
  a,
  button,
  .portfolio-item,
  .filter-btn {
    cursor: none;
  }
}

/* =========================================
   Navbar Styles (Mobile & Desktop)
   ========================================= */
.navbar {
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 1.2rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 10000;
  border-bottom: 1px solid var(--border-color);
}

.logo img {
  height: 50px;
  width: auto;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 30px;
  padding: 0;
  margin: 0;
}

.navbar a {
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.3s;
}

.navbar a:hover,
.navbar a.active {
  color: var(--accent-color);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.menu-close {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

@media (max-width: 900px) {

  /* Mobile Grid Typography Tweaks for 2 Columns */
  .portfolio-item__title {
    font-size: 1rem;
    /* Smaller font for 2-col */
  }

  .portfolio-item__overlay {
    padding: 15px;
    /* Less padding */
  }

  .portfolio-item__category {
    font-size: 0.75rem;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    font-size: 1.5rem;

    /* New Premium Design */
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    /* Glass */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--accent-color);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
  }

  .menu-toggle:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px var(--accent-color);
    transform: scale(1.05);
  }

  /* Restored Sidebar Nav - Aligned with Home Page */
  .navbar ul.nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    visibility: hidden;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s linear 0.4s;
    z-index: 1500;
  }

  .navbar ul.nav-links.active {
    display: flex;
    visibility: visible;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s linear 0s;
  }

  /* Nav Links Animation on Mobile */
  .navbar ul.nav-links li {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: block;
  }

  .navbar ul.nav-links.active li {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
  }

  /* Show Social Bar in Mobile Menu (Bottom Horizontal) */
  .navbar-social {
    display: flex !important;
    gap: 25px;
    z-index: 1501;
    position: fixed;
    bottom: 40px;
    top: auto;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
    pointer-events: none;
    flex-direction: row;
  }

  .navbar ul.nav-links.active~.navbar-social {
    opacity: 1;
    pointer-events: auto;
  }

  .navbar-social a {
    color: #fff;
    font-size: 1.8rem;
    transition: transform 0.3s, color 0.3s;
  }

  .navbar-social a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
  }

  .menu-close {
    display: none !important;
  }

  .navbar a {
    font-size: 1.5rem;
    margin: 15px 0;
    font-weight: 700;
  }
}

/* =========================================
   Mobile Optimization (Redesign)
   ========================================= */
@media (max-width: 768px) {

  /* Header typography & spacing */
  .header {
    padding: 120px 20px 30px;
  }

  .header__title {
    font-size: 2.5rem;
  }

  /* Scrollable Filters for cleaner mobile UI */
  .filter {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
  }

  .filter::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
  }

  .filter__btn {
    flex-shrink: 0;
    font-size: 0.85rem;
    padding: 10px 20px;
  }

  /* Fullscreen Modal on Mobile for Immersion */
  .modal__container {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-width: none;
    transform: translateY(100%);
    /* Slide from bottom */
  }

  /* Make close button more accessible */
  .modal__close {
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
  }

  .modal__details {
    padding: 30px 20px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .modal__image-container {
    flex: 1;
    /* Equal split or image favored */
  }
}