/* CCX Management - Visual Enhancement Layer */
/* This stylesheet adds polish, micro-interactions, and refinements on top of the base design */

/* ============================================
   1. GLOBAL REFINEMENTS
   ============================================ */

/* Smoother font rendering */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Selection color matching brand */
::selection {
  background-color: rgba(75, 108, 255, 0.3);
  color: #fff;
}

::-moz-selection {
  background-color: rgba(75, 108, 255, 0.3);
  color: #fff;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #070a12;
}

::-webkit-scrollbar-thumb {
  background: rgba(75, 108, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 108, 255, 0.5);
}

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(75, 108, 255, 0.3) #070a12;
}

/* ============================================
   2. ENHANCED CARD EFFECTS
   ============================================ */

/* Elevated card hover with subtle glow */
.card-surface {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s ease,
              box-shadow 0.4s ease;
  will-change: transform;
}

.card-surface:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(75, 108, 255, 0.1);
}

/* ============================================
   3. BUTTON ENHANCEMENTS
   ============================================ */

/* Primary button glow and press effects */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: scale(0.97);
}

/* Secondary button shine effect */
.btn-secondary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transition: left 0.5s ease;
}

.btn-secondary:hover::before {
  left: 100%;
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* ============================================
   4. FOCUS & ACCESSIBILITY
   ============================================ */

/* Visible focus rings for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(75, 108, 255, 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: 2px solid rgba(75, 108, 255, 0.7);
  outline-offset: 3px;
}

/* ============================================
   5. IMAGE ENHANCEMENTS
   ============================================ */

/* Smooth image loading */
img {
  transition: opacity 0.4s ease;
}

/* Hero image parallax smoothing */
.will-change-transform {
  transition: transform 0.1s linear;
}

/* ============================================
   6. NAVIGATION POLISH
   ============================================ */

/* Larger proportional logo for better brand presence */
nav a[href="/"] > img[alt="CCX Management Inc."] {
  height: clamp(4.25rem, 8vw, 5rem) !important;
  width: auto !important;
  max-width: min(42vw, 240px);
  object-fit: contain;
}

/* Active nav link indicator */
nav a[class*="text-cobalt"]::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: #4b6cff;
  border-radius: 1px;
  margin-top: 4px;
  animation: navIndicator 0.3s ease forwards;
}

@keyframes navIndicator {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* Nav link hover underline */
nav a:not([class*="text-cobalt"]):not(.btn-secondary)::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(75, 108, 255, 0.5);
  border-radius: 1px;
  margin-top: 4px;
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

nav a:not([class*="text-cobalt"]):not(.btn-secondary):hover::after {
  transform: scaleX(1);
}

/* ============================================
   7. SECTION TRANSITIONS (Scroll Reveal)
   ============================================ */

/* Smooth entrance animations via Intersection Observer */
.section-padding {
  animation: sectionFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0.6;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   8. SUBTLE BACKGROUND TEXTURE
   ============================================ */

/* Noise texture overlay for depth */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============================================
   9. FORM INPUT IMPROVEMENTS
   ============================================ */

/* Better form inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  border-color: rgba(75, 108, 255, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(75, 108, 255, 0.1);
}

/* ============================================
   10. FOOTER LINK ANIMATIONS
   ============================================ */

/* Footer link hover effects */
footer a {
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

footer a:hover {
  transform: translateX(2px);
}

/* Social icons hover pulse */
footer a[class*="rounded-full"]:hover {
  transform: translateY(-2px) scale(1.05);
}

/* ============================================
   11. HERO SECTION ENHANCEMENTS
   ============================================ */

/* Improve hero gradient for better text readability */
.hero-gradient {
  background: linear-gradient(
    180deg,
    rgba(7, 10, 18, 0.4) 0%,
    rgba(7, 10, 18, 0.6) 40%,
    rgba(7, 10, 18, 0.85) 100%
  ) !important;
}

/* Animated gradient accent line */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================
   12. LOADING TRANSITION
   ============================================ */

/* Smooth page load */
#root {
  animation: pageLoad 0.6s ease forwards;
}

@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   13. RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Better touch targets on mobile */
@media (max-width: 1023px) {
  nav a[href="/"] > img[alt="CCX Management Inc."] {
    height: clamp(3.9rem, 14vw, 4.5rem) !important;
    max-width: min(58vw, 220px);
  }

  .btn-primary,
  .btn-secondary {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Improve readability on small screens */
@media (max-width: 640px) {
  .section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

/* ============================================
   14. PRINT STYLES
   ============================================ */

@media print {
  body::after {
    display: none;
  }

  nav,
  footer {
    display: none;
  }

  .hero-gradient {
    background: none !important;
  }

  * {
    color: #000 !important;
    background: #fff !important;
  }
}
