/* CodeYou - Mobile-First High-End UI & Haptic Touch Design System */
:root {
  --bg-dark: #060611;
  --bg-dark-card: rgba(14, 14, 30, 0.75);
  --bg-dark-card-inner: rgba(10, 10, 22, 0.85);
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-dark-hover: rgba(168, 85, 247, 0.45);
  
  --bg-light: #f4f6fc;
  --bg-light-card: rgba(255, 255, 255, 0.90);
  --bg-light-card-inner: rgba(248, 250, 252, 0.95);
  --border-light: rgba(0, 0, 0, 0.06);
  --border-light-hover: rgba(124, 58, 237, 0.35);

  --accent-gradient: linear-gradient(135deg, #d946ef 0%, #8b5cf6 50%, #06b6d4 100%);
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #d946ef;
}

/* Base Body Styles */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

body.dark {
  background-color: var(--bg-dark);
  color: #e2e8f0;
}

body.light {
  background-color: var(--bg-light);
  color: #1e293b;
}

/* Aurora Glow Background (Hardware Accelerated, Smooth on Phones) */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
}

.dark .aurora-blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.22;
  border-radius: 50%;
  will-change: transform;
  animation: floatMobile 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.dark .blob-1 {
  top: -10%;
  left: 10%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}

.dark .blob-2 {
  top: 40%;
  right: -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  animation-delay: -5s;
}

.dark .blob-3 {
  bottom: -5%;
  left: 20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #d946ef 0%, transparent 70%);
  animation-delay: -10s;
}

.light .aurora-blob {
  position: absolute;
  filter: blur(90px);
  opacity: 0.16;
  border-radius: 50%;
  animation: floatMobile 20s infinite alternate ease-in-out;
}

.light .blob-1 {
  top: -10%;
  left: 15%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
}

.light .blob-2 {
  top: 45%;
  right: 0%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
}

@keyframes floatMobile {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(25px, 20px, 0) scale(1.05); }
  100% { transform: translate3d(-20px, -15px, 0) scale(0.96); }
}

/* Double-Bezel (Doppelrand) Nested Card Architecture */
.double-bezel {
  padding: 2px;
  border-radius: 1.5rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}

.double-bezel-inner {
  border-radius: calc(1.5rem - 2px);
  background: var(--bg-dark-card-inner);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.light .double-bezel {
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.02) 100%);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
}

.light .double-bezel-inner {
  background: var(--bg-light-card-inner);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Glowing Border Animation for Featured Items */
.glow-border {
  position: relative;
}

.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(90deg, #d946ef, #8b5cf6, #06b6d4, #d946ef);
  background-size: 300% 300%;
  border-radius: inherit;
  z-index: -1;
  animation: glowRotate 6s linear infinite;
  opacity: 0.75;
}

@keyframes glowRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Glassmorphism Classes */
.glass-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.25rem;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease;
  transform: translate3d(0, 0, 0);
}

.dark .glass-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-dark);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
}

.light .glass-card {
  background: var(--bg-light-card);
  border: 1px solid var(--border-light);
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.05);
}

/* Touch & Tap Spring Feedback */
.touch-active {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), filter 0.15s ease;
}

.touch-active:active {
  transform: scale(0.96) !important;
  filter: brightness(1.1);
}

/* Gradient Text */
.grad-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gradient Buttons with Touch Wave */
.btn-primary-grad {
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary-grad:active {
  transform: scale(0.96);
  filter: brightness(1.12);
}

/* Ripple Touch Effect */
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.5s linear;
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* Horizontal Scroll Bar Hider */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mobile App Floating Bottom Navigation Bar */
.bottom-nav {
  display: none;
}

@media (max-width: 1023px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    left: 12px;
    right: 12px;
    max-width: 440px;
    margin: 0 auto;
    z-index: 50;
    border-radius: 9999px;
    padding: 6px 8px;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translate3d(0, 0, 0);
  }
  
  .dark .bottom-nav {
    background: rgba(12, 12, 28, 0.92);
  }
  
  .light .bottom-nav {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 35px -6px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.08);
  }
  
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 10px;
    font-weight: 600;
    padding: 6px 2px;
    color: #94a3b8;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 1.25rem;
    position: relative;
  }
  
  .bottom-nav-item.active {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.16);
    transform: translateY(-2px);
  }
  
  .bottom-nav-item:active {
    transform: scale(0.90);
  }
  
  .bottom-nav-item i {
    font-size: 17px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
  }
  
  .bottom-nav-item.active i {
    transform: scale(1.1);
  }
}

/* Mobile Bottom Sheet Modal Styling */
@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  
  .modal-dialog {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 1.75rem !important;
    border-top-right-radius: 1.75rem !important;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(100%);
  }
  
  .modal-overlay.active .modal-dialog {
    transform: translateY(0);
  }
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Shimmer Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}

/* Custom Admin Scrollbars */
#adminSidebar::-webkit-scrollbar {
  width: 5px;
}
#adminSidebar::-webkit-scrollbar-track {
  background: transparent;
}
#adminSidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
#adminSidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

/* Admin Input Glows */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}
