/* Basic Reset and Global Styles */
:root {
  --background-color: #0a0a0a;
  --text-color: #f0f0f0;
  --primary-accent: #ffffff;
  --overlay-bg: rgba(10, 10, 10, 0.98);
  --transition-speed-fast: 0.5s;
  --transition-speed-slow: 0.8s;
  --easing: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  overflow-x: hidden;
}

/* Particle.js Canvas */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 1;
}
/* logo */
h1.logo img {
  max-width: 200px;
}
/* Background Video */
.background-video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
}

#bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 0;
}

/* Section Wrapper */
.section-wrapper {
  position: relative;
  z-index: 10;
}

/* Main Content Wrapper */
.main-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
  position: relative;
}

/* --- CSS FIX 1: Logo Styling --- */
.main-content .logo {
  max-width: 300px; /* Adjust as needed */
  margin-bottom: 40px;
  position: relative;
  z-index: 15;
}
.main-content .logo img {
  width: 100%;
  height: auto;
}

/* Portfolio Thumbnails Grid */
.portfolio-nav {
  display: flex; /* Changed from grid to flex */
  flex-wrap: wrap; /* Added to allow items to wrap */
  justify-content: center; /* Centers items horizontally in flex container */
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto; /* Added to center the grid */
  /* justify-items: center; Removed as it's a grid property */
}

.nav-item {
  /* Removed background-image related properties */
  background-color: #22222201; /* Default darker background */
  background-size: cover; /* Kept for potential future use or if thumb is reintroduced */
  background-position: center; /* Kept for potential future use or if thumb is reintroduced */
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--easing), box-shadow 0.4s ease,
    background-color 0.4s ease; /* Added background-color transition */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  will-change: transform, box-shadow, background-image; /* Added background-image */
  flex: 1 1 calc(33.333% - 10px); /* Adjust flex basis for 3 columns with gap */
  max-width: calc(33.333% - 10px); /* Ensure max width for 3 columns */
  display: flex; /* Added to center title vertically */
  align-items: center; /* Center title vertically */
  justify-content: center; /* Center title horizontally */
  text-align: center; /* Ensure title text is centered */
  border: 2px solid rgba(196, 8, 8, 0.34); /* Default thick, subtle white border */
  transition: transform 0.4s var(--easing), box-shadow 0.4s ease,
    background-color 0.4s ease, border-color 0.4s ease; /* Added border-color to transition */
}

.nav-item:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  /* Animated gradient on hover (as before) */
  background: linear-gradient(78deg, #f2dfcdff, #ff0a0aff, #cb0de9ff);
  background-size: 200% 200%;
  animation: gradientAnimation 1s ease infinite;

  /* Glowing border on hover */
  border-color: transparent; /* Hide the default border when the glow is active */
  box-shadow: 0 0 15px 5px rgba(255, 0, 0, 0.7),
    /* Red glow */ 0 0 30px 10px rgba(255, 255, 0, 0.5); /* Yellow glow */
}

/* Keyframes for gradient animation (remain the same) */
@keyframes gradientAnimation {
  0% {
    background-position: 0% 0%;
  }
  25% {
    background-position: 100% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

.nav-item-overlay {
  width: 100%;
  height: 100%;
  /* Changed default background to be subtle or transparent */
  background: rgba(0, 0, 0, 0.8); /* Changed opacity to 0.8 */
  display: flex;
  align-items: center; /* Center content vertically */
  padding: 15px;
  transition: background 0.4s ease;
  position: absolute; /* Position overlay over the item */
  top: 0;
  left: 0;
  justify-content: center; /* Center content horizontally */
}

.nav-item:hover .nav-item-overlay {
  background: rgba(0, 0, 0, 0.8); /* Changed opacity to 0.8 on hover as well */
}

.nav-item-title {
  font-size: 2rem; /* Increased font size */
  font-weight: 800; /* Made text bolder */
  letter-spacing: 1px;
  line-height: 1;
  color: var(--text-color);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); /* Added text shadow for better readability */
  text-transform: uppercase; /* Made text uppercase */
  transform: scale(1); /* Initial scale */
  opacity: 1; /* Always visible */
  transition: transform 0.3s ease; /* Smooth transition for scale */
  position: relative; /* Ensure title is above overlay if needed */
  z-index: 2; /* Ensure title is above overlay */
}

.nav-item:hover .nav-item-title {
  transform: scale(1.1); /* Scale up on hover */
}
/* Glowing Border for Portfolio Items on Hover */
.nav-item::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 10px; /* Slightly more than item border-radius for overlap */
  background: linear-gradient(
    45deg,
    #ff0000,
    #ffff00,
    #ff0000
  ); /* Red to Yellow gradient */
  background-size: 400% 400%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease, background-position 0.8s ease;
}

.nav-item:hover::before {
  opacity: 1;
  animation: glowingBorder 3s linear infinite;
}

@keyframes glowingBorder {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* --- CSS FIX 2: Scroll Buttons --- */
.scroll-down-btn,
.scroll-up-btn {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background: none;
  transition: transform 0.3s ease, background-color 0.3s ease;
}
.scroll-down-btn svg,
.scroll-up-btn svg {
  width: 100%;
  height: 100%;
  fill: var(--text-color);
  transition: transform 0.3s ease;
}
.scroll-down-btn:hover svg,
.scroll-up-btn:hover svg {
  transform: scale(1.1);
}

/* Positioning for scroll up button in contact section */
#contact-section .scroll-up-btn {
  bottom: 50px; /* Adjust if needed */
}

/* About Us Section */
#about-us-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 40px;
  background-color: #000;
  text-align: center;
  position: relative;
}

#about-us-section h2 {
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 20px;
}

#about-us-section p {
  font-size: 2rem;
  line-height: 1.8;
  max-width: 800px;
  color: #f0f0f0;
  margin-bottom: 100px; /* Space for scroll button */
}

/* Contact Section */
#contact-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column; /* Center container and button */
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  background-color: rgba(6, 6, 6, 0.3);
  position: relative;
}

.contact-container {
  display: flex;
  gap: 50px;
  max-width: 1100px;
  width: 100%;
}

.contact-info,
.contact-form-container {
  flex: 1;
}

.contact-info h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 30px;
}

.contact-info p {
  font-size: 1.2rem;
  line-height: 1.5;
  color: #f0f0f0;
  margin-bottom: 40px;
}

.contact-details-list li {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  font-size: 1.3rem;
  line-height: 0.9;
}

.contact-details-list li svg {
  width: 24px;
  height: 24px;
  margin-right: 15px;
  fill: var(--text-color);
}

.contact-details-list li a {
  color: var(--text-color);
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-details-list li a:hover {
  color: #9a3220;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px;
  margin-bottom: 20px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid #f0f0f0;
  border-radius: 5px;
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #f0f0f0;
  opacity: 0.7;
}

.contact-form textarea {
  resize: vertical;
  min-height: 150px;
}

.contact-form button {
  padding: 15px 30px;
  background-color: #f0f0f0;
  border: none;
  border-radius: 5px;
  color: #000000ff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.contact-form button:hover {
  background-color: #ffffff;
  color: #9a3220;
}

.contact-form button:focus {
  outline: 2px solid var(--primary-accent);
  outline-offset: 2px;
}

/* Fullscreen Portfolio Viewer */
.portfolio-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-bg);
  z-index: 200;
  clip-path: circle(0% at 50% 50%);
  visibility: hidden;
  transition: clip-path var(--transition-speed-slow) var(--easing),
    visibility 0s var(--transition-speed-slow);
}

.portfolio-viewer.active {
  clip-path: circle(150% at 50% 50%);
  visibility: visible;
  transition-delay: 0s;
}

.close-viewer-btn {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 3rem;
  color: var(--text-color);
  cursor: pointer;
  background: none;
  border: none;
  z-index: 210;
  transition: transform 0.4s ease, color 0.4s ease;
  will-change: transform, color;
}

.close-viewer-btn:hover {
  transform: rotate(90deg);
  color: #ff4d4d;
}

.portfolio-slider {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform var(--transition-speed-slow) var(--easing);
}

.portfolio-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vw;
}

.slide-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s ease 0.4s, transform 0.7s ease 0.4s;
}

.portfolio-viewer.active .slide-content {
  opacity: 1;
  transform: scale(1);
}

.slide-content img,
.slide-content video {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 800px) {
  .portfolio-nav {
    flex-direction: row; /* Ensure row direction for flex */
    justify-content: center; /* Center items for 2 columns */
    gap: 15px;
  }
  .nav-item {
    flex: 1 1 calc(50% - 15px); /* Adjust flex basis for 2 columns with gap */
    max-width: calc(50% - 15px);
  }
  .contact-container {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .main-content .logo {
    max-width: 200px; /* Smaller logo on mobile */
  }
  .portfolio-nav {
    gap: 10px;
  }
  .nav-item {
    flex: 1 1 calc(50% - 10px); /* Adjust flex basis for 2 columns with gap */
    max-width: calc(50% - 10px);
  }
  .close-viewer-btn {
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
  }
  .portfolio-slide {
    padding: 4vw;
  }
}

@media (max-width: 480px) {
  .portfolio-nav {
    flex-direction: column; /* Stack items vertically */
    align-items: center;
    max-width: 90vw;
    gap: 15px;
  }
  .nav-item {
    width: 100%;
    flex: 1 1 100%; /* Full width for single column */
    max-width: none;
  }
  .main-content {
    height: auto;
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 100px;
  }
}
