/* Custom Color Palette */
:root {
  --midnight: #1a1f3a;
  --ocean: #2d5f8d;
  --bay: #4a90c5;
  --sunrise: #f4a261;
  --coral: #e76f51;
  --cream: #fef9f3;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Typography */
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: linear-gradient(
    to bottom,
    #fef9f3 0%,
    white 20%,
    #f9fafb 40%,
    white 60%,
    #fef9f3 80%,
    white 100%
  );
}

h1,
h2,
.section-title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

/* Typography Tweaks */
.section-title {
  @apply text-3xl md:text-4xl font-bold text-gray-900;
  position: relative;
  display: inline-block;
}

.section-title::before {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: linear-gradient(to right, #4a90c5, #f4a261);
  margin-bottom: 16px;
  border-radius: 50px;
}

.subheading {
  @apply text-xl font-semibold text-gray-800;
}

.subheading.mb-0 {
  margin-bottom: 0;
}

.body-text {
  @apply mt-2 text-gray-600 leading-relaxed;
}

/* Buttons */
.btn-primary {
  @apply text-white font-semibold shadow-lg;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--sunrise), var(--coral));
  border-radius: 50px;
  transition: all 0.3s ease-out;
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 50;
}

.btn-primary:hover {
  background: linear-gradient(to right, var(--coral), var(--sunrise));
  transform: scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(244, 162, 97, 0.3),
    0 10px 10px -5px rgba(244, 162, 97, 0.2);
}

/* Better focus states for accessibility */
a:focus-visible,
button:focus-visible {
  @apply outline outline-2 outline-offset-2 ring-0;
  outline-color: var(--bay);
}

/* Link hover states */
a.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(74, 144, 197, 0.3);
}

/* Enhanced card styles */
.project-card,
.skill-card {
  transition: all 0.3s ease-out;
}

.project-card {
  cursor: pointer;
}

.project-card:hover,
.skill-card:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border-color: var(--bay);
  transform: translateY(-4px);
}

/* Section flow - remove all rigid backgrounds */
section {
  background: transparent !important;
  border: none;
}

/* Central logo showcase */
.logo-showcase {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.featured-logo {
  max-width: 400px;
  max-height: 200px;
  object-fit: contain;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.1));
}

/* Visit Site Button */
.visit-site-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--bay), var(--sunrise));
  color: white;
  text-decoration: none;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0.95;
  display: none; /* Hidden by default on desktop */
}

.visit-site-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 197, 0.4);
  opacity: 1;
}

/* Company name links */
.company-link {
  font-size: 1.25rem;
  font-weight: 700;
  color: rgb(156, 163, 175);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 50px;
  transition: all 0.3s ease;
  position: relative;
}

.company-link:hover {
  color: var(--bay);
  background: rgba(74, 144, 197, 0.08);
  transform: translateY(-2px);
}

.company-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: linear-gradient(to right, var(--bay), var(--sunrise));
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.company-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.company-link.active {
  color: var(--bay);
  background: rgba(74, 144, 197, 0.12);
  font-weight: 800;
}

.company-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Project Modal */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-modal.active {
  display: flex;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 95%;
  max-width: 1400px;
  max-height: 90vh;
  margin: auto;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 28px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.modal-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 90vh;
  max-height: 90vh;
}

@media (max-width: 968px) {
  /* Make close button sticky and more accessible */
  .modal-close {
    position: fixed; /* Stay visible while scrolling */
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
  }

  .modal-grid {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 95vh;
    overflow-y: auto; /* Single scroll for entire modal */
  }

  /* Compact sidebar - no scrolling */
  .modal-sidebar {
    overflow-y: visible;
    overflow-x: visible;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(
      135deg,
      rgba(74, 144, 197, 0.05),
      rgba(141, 186, 229, 0.03)
    );
  }

  /* Tighter spacing for mobile */
  .sidebar-section {
    margin-bottom: 16px;
  }

  /* Company and Industry inline */
  .sidebar-section:nth-child(1),
  .sidebar-section:nth-child(2) {
    display: inline-block;
    margin-right: 16px;
    margin-bottom: 12px;
  }

  .sidebar-label {
    font-size: 0.65rem;
    margin-bottom: 4px;
  }

  .sidebar-value {
    font-size: 0.95rem;
  }

  /* Tech stack - horizontal scroll */
  .tech-stack-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    mask-image: none;
    -webkit-mask-image: none;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Hide scrollbar but keep functionality */
  .tech-stack-scroll::-webkit-scrollbar {
    height: 4px;
  }

  .tech-stack-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
  }

  .tech-stack-scroll::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 197, 0.3);
    border-radius: 2px;
  }

  .tech-logos {
    animation: none; /* Disable auto-scroll on mobile */
    gap: 12px;
  }

  .tech-logo-item {
    min-width: 70px;
    padding: 10px 14px;
  }

  .tech-logo-item img {
    width: 40px;
    height: 40px;
  }

  .tech-logo-name {
    font-size: 0.7rem;
  }

  /* CTA button - keep visible */
  .sidebar-btn {
    margin-top: 16px;
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  /* Main content - single scroll */
  .modal-main {
    padding: 24px 20px 40px;
    overflow-y: visible; /* Parent handles scrolling */
  }

  .modal-title {
    font-size: 1.75rem;
    margin-bottom: 20px;
    line-height: 1.3;
  }

  /* Compact content sections */
  .modal-description {
    margin-bottom: 28px;
  }

  .modal-description h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }

  .modal-description p,
  .modal-description li {
    font-size: 1rem;
    line-height: 1.6;
  }

  .modal-description li {
    padding-left: 20px;
    margin-bottom: 6px;
  }

  /* Hero image */
  .modal-hero-image {
    margin-bottom: 24px;
  }

  .modal-hero-image img {
    max-height: 400px;
  }

  /* Video section */
  .modal-video-section {
    margin-bottom: 28px;
  }

  .modal-video-section h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }

  .project-video {
    max-height: 400px;
  }

  /* Gallery */
  .modal-gallery h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }

  .gallery-grid {
    gap: 12px;
  }

  .gallery-image {
    height: 150px;
  }
}

/* Modal Sidebar */
.modal-sidebar {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 197, 0.08),
    rgba(141, 186, 229, 0.05)
  );
  padding: 60px 30px 30px;
  overflow-y: auto;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(107, 114, 128);
  margin-bottom: 8px;
  font-weight: 600;
}

.sidebar-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(31, 41, 55);
}

.tech-stack-scroll {
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
}

.tech-logos {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: scroll-left 30s linear infinite;
}

.tech-logos:hover {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.tech-logo-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: white;
  border-radius: 12px;
  border: 1px solid rgb(229, 231, 235);
  min-width: 80px;
  transition: all 0.3s ease;
}

.tech-logo-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--bay);
}

.tech-logo-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.tech-logo-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(75, 85, 99);
  text-align: center;
  text-transform: capitalize;
}

/* Home Tech Stack Carousel */
.home-tech-scroll {
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 15%,
    black 85%,
    transparent
  );
  padding: 20px 0;
}

.home-tech-logos {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: scroll-left 25s linear infinite;
}

.home-tech-logos:hover {
  animation-play-state: paused;
}

.home-tech-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: white;
  border-radius: 16px;
  border: 2px solid rgb(229, 231, 235);
  min-width: 100px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.home-tech-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--bay);
}

.home-tech-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.home-tech-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(31, 41, 55);
  text-align: center;
}

.sidebar-btn {
  display: block;
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--sunrise), var(--coral));
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 32px;
}

.sidebar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(244, 162, 97, 0.4);
}

/* Modal Main Content */
.modal-main {
  padding: 60px 40px 40px;
  overflow-y: auto;
}

.modal-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: rgb(17, 24, 39);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.modal-hero-image {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
}

.modal-hero-image img {
  width: 100%;
  max-height: 700px;
  object-fit: contain;
  display: block;
}

.modal-description {
  margin-bottom: 40px;
}

.modal-description h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: rgb(31, 41, 55);
}

.modal-description p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgb(75, 85, 99);
}

.modal-description ul {
  list-style: none;
  padding: 0;
}

.modal-description li {
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgb(75, 85, 99);
  padding-left: 24px;
  position: relative;
  margin-bottom: 8px;
}

.modal-description li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--bay);
  font-weight: bold;
  font-size: 1.5rem;
}

/* Video Section */
.modal-video-section {
  margin-bottom: 40px;
}

.modal-video-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: rgb(31, 41, 55);
}

.video-container {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2);
}

.project-video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 600px;
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-play-overlay:hover {
  background: rgba(0, 0, 0, 0.5);
}

.video-play-overlay.hidden {
  display: none;
}

.video-play-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.video-play-button:hover {
  transform: scale(1.1);
}

.video-play-button svg {
  display: block;
}

.modal-gallery h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: rgb(31, 41, 55);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item img:hover {
  transform: scale(1.02);
}

/* Image Lightbox */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  cursor: pointer;
}

#lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 48px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 40px;
}

.lightbox-next {
  right: 40px;
}

.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1rem;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
  .lightbox-content {
    padding: 20px;
  }

  .lightbox-prev {
    left: 10px;
    width: 50px;
    height: 50px;
  }

  .lightbox-next {
    right: 10px;
    width: 50px;
    height: 50px;
  }

  #lightbox-image {
    max-width: 95%;
    max-height: 85%;
  }

  /* Companies Section - Mobile Optimizations */
  .logo-showcase {
    height: 200px;
    padding: 20px;
  }

  .featured-logo {
    max-width: 300px;
    max-height: 150px;
  }

  .visit-site-btn {
    display: inline-block; /* Show on mobile */
    top: 12px;
    right: 12px;
    padding: 10px 18px;
    font-size: 0.9rem;
  }

  .company-link {
    font-size: 1.1rem;
    padding: 10px 14px;
  }

  .company-link.active {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(74, 144, 197, 0.2);
  }
}
