/* 
 * Modern glassmorphism and enhanced styling 
 * 
 * This stylesheet defines the custom styles used throughout the website, 
 * focusing on glassmorphism effects, gradients, and responsive design.
 * It complements the Tailwind CSS utility classes used in the HTML.
 */

/* 
 * CSS Variables for Themeing
 */
:root {
  /* Light Mode Defaults */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.05);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.1);
  --glass-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  --divider-gradient: linear-gradient(90deg, #e5e7eb, #9ca3af, #e5e7eb);
  --divider-shadow: 0 0 10px 2px rgba(156, 163, 175, 0.2);

  --gradient-text-bg: linear-gradient(135deg, #111827, #374151, #4b5563);

  --skill-badge-bg: rgba(0, 0, 0, 0.05);
  --skill-badge-border: rgba(0, 0, 0, 0.1);
  --skill-badge-text: #374151;
  --skill-badge-hover-bg: rgba(0, 0, 0, 0.1);
  --skill-badge-hover-border: rgba(0, 0, 0, 0.2);
  --skill-badge-hover-text: #111827;
}

/* Dark Mode Overrides */
html.dark {
  --glass-bg: rgba(28, 28, 30, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
  --glass-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.15);

  --divider-gradient: linear-gradient(90deg, #c0c0c0, #e5e7eb, #f3f4f6);
  --divider-shadow: 0 0 20px 6px rgba(192, 192, 192, 0.3);

  --gradient-text-bg: linear-gradient(135deg, #c0c0c0, #e5e7eb, #f9fafb);

  --skill-badge-bg: rgba(192, 192, 192, 0.1);
  --skill-badge-border: rgba(192, 192, 192, 0.2);
  --skill-badge-text: #d1d5db;
  --skill-badge-hover-bg: rgba(192, 192, 192, 0.2);
  --skill-badge-hover-border: rgba(192, 192, 192, 0.4);
  --skill-badge-hover-text: #e5e7eb;
}

/* 
 * Section Divider
 * Creates a visual separation between sections with a glowing gradient effect.
 */
.section-divider {
  width: 100%;
  height: 4px;
  margin: 3rem 0 2rem 0;
  border-radius: 9999px;
  background: var(--divider-gradient);
  box-shadow: var(--divider-shadow);
  opacity: 0.9;
}

@media (max-width: 640px) {
  .section-divider {
    margin: 2rem 0 1.5rem 0;
    height: 3px;
  }
}

/* 
 * Glassmorphism Cards
 * These styles create a frosted glass effect for content containers.
 */
.glass-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  /* Slightly darken/lighten on hover depending on theme */
  border-color: var(--glass-border);
  box-shadow:
    var(--glass-shadow-hover),
    0 0 20px rgba(192, 192, 192, 0.1),
    /* Subtle glow */
    var(--glass-inset-highlight);
  transform: translateY(-2px);
}

/* 
 * Utility Shadows
 */
.apple-shadow {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.accent-glow {
  box-shadow: 0 0 20px rgba(192, 192, 192, 0.4);
}

/* Adjust accent glow for light mode */
html:not(.dark) .accent-glow {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  /* Blueish glow for light mode */
}


/* 
 * Typography Enhancements
 */
.gradient-text {
  background: var(--gradient-text-bg);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.modern-heading {
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.modern-text {
  letter-spacing: 0.01em;
  line-height: 1.6;
}

/* 
 * Animated Gradient Background
 * Creates a subtle moving gradient background effect.
 */
.animated-gradient {
  background: linear-gradient(-45deg, #1f2937, #374151, #4b5563, #1f2937);
  background-size: 400% 400%;
  animation: gradient 20s ease infinite;
}

/* Light mode animated gradient */
html:not(.dark) .animated-gradient {
  background: linear-gradient(-45deg, #eff6ff, #dbeafe, #bfdbfe, #eff6ff);
}


@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* 
 * Skill Badges
 * Styles for the tags listed in the skills section.
 */
.skill-badge {
  display: inline-block;
  background: var(--skill-badge-bg);
  border: 1px solid var(--skill-badge-border);
  color: var(--skill-badge-text);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0.25rem;
  transition: all 0.2s ease;
}

.skill-badge:hover {
  background: var(--skill-badge-hover-bg);
  border-color: var(--skill-badge-hover-border);
  color: var(--skill-badge-hover-text);
  transform: translateY(-1px);
}

/* 
 * Project Cards
 * interactive cards for displaying portfolio projects.
 */
.project-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--glass-border);
}

.project-card:hover {
  border-color: var(--skill-badge-hover-border);
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 20px rgba(192, 192, 192, 0.15);
}

/* 
 * General Utilities
 */
html {
  scroll-behavior: smooth;
}


/* Enhanced focus states for accessibility */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(192, 192, 192, 0.5), 0 0 0 4px rgba(0, 0, 0, 0.1);
}

html:not(.dark) .focus-ring:focus {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5), 0 0 0 4px rgba(0, 0, 0, 0.1);
}


/* 
 * Carousel Component Styles
 */
.carousel-container {
  display: none !important;
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto 0;
  /* Removed bottom margin to reduce gap */
  overflow: hidden;
  position: relative;
  background: #fff;
  /* Logo carousel usually needs white bg for logos? Or glass? */
  /* Reverting to white for light mode, checking logic */
  background: var(--glass-bg);
  /* Use glass bg to adapt */

  border-radius: 0.75rem;
  /* rounded-xl equivalent */
  padding: 20px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

/* Ensure logos look okay on dark mode if they are transparent pngs. 
   If they have white backgrounds, we might need a white container. 
   The original CSS had background: #fff; for .carousel-container.
   Let's keep it #fff for logos if they rely on it, but use variables if we can. 
   Most logos seem to be PNG/SVG. If they are dark text, they need light BG.
   If they are white text, they need dark BG.
   Looking at images: 'schwab.png', 'Broadridge...svg'.
   Usually company logos are colored/dark.
   Let's force a lightish background for the carousel track AREA even in dark mode?
   Or better: keep the original #fff background for the carousel container to ensure logo visibility,
   or enable a "dark mode compatible" logo set.
   Given the file list, we don't have separate dark logos.
   So let's keep the carousel container white-ish or adapt carefully.
   Original was `background: #fff`.
   Let's try `background: rgba(255,255,255, 0.9)` in dark mode to ensure logos show up?
   Or if logos are white text...
   Let's check the logos. Schwab is blue/black. Randstad is blue.
   They need a light background.
*/

.carousel-container {
  background: rgba(255, 255, 255, 0.9);
  /* Keep it light for logo visibility */
}

html.dark .carousel-container {
  background: rgba(255, 255, 255, 0.95);
  /* Still keep it light in dark mode for now unless we have white logos */
}


.carousel-track {
  display: flex;
  align-items: center;
  /* 
   * @context Removed 'gap' to fix animation jump at loop point.
   * Spacing is now handled by margin-right on .logo-item.
   */
  width: max-content;
  animation: scroll 15s linear infinite;
}

.carousel-track:hover {
  animation-play-state: paused;
}

.logo-item {
  width: 160px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 
   * @context Using margin-right instead of gap on parent.
   * Gap only adds space BETWEEN items, but not after the last one,
   * causing a "jump" when the identical clone set takes over at 50%.
   */
  margin-right: 60px;
}

.logo-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  /* Optional: Add a subtle grayscale filter that lifts on hover for a premium feel */
  /* filter: grayscale(100%); */
  /* opacity: 0.7; */
  /* transition: all 0.3s ease; */
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.carousel-pause-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 10;
  transition: background 0.3s;
}

.carousel-pause-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-pause-btn span {
  font-size: 14px;
  line-height: 1;
}

.carousel-track.paused {
  animation-play-state: paused !important;
}