@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --color-background-primary: 33, 33, 39;
    --color-background-secondary: 66, 66, 77;
  }
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
  background: rgb(var(--color-background-primary));
}

::-webkit-scrollbar-thumb {
  background: rgb(var(--color-background-secondary));
  border-radius: 2cqw;
}

::-webkit-scrollbar-track {
  border-radius: 2px;
}

@layer components {
  .invisible-a {
    display: block;
    text-decoration: none;
    border: none;
    padding: 0;
    margin: 0;
  }

  .invisible-a:hover,
  .invisible-a:focus,
  .invisible-a:active {
    text-decoration: none;
  }
  .panel {
    border-radius: 0.416rem;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 1);
    padding: 1rem;
    box-shadow: 0 0 0 0 #0000, 0 0 0 0 #0000, 0 0 0 0 #0000, 0 0 0 0 #0000,
      0 4px 10px rgba(0, 0, 0, 0.375);
    background: #212127;
    background-origin: border-box;
  }
  .btn_connect {
    background-color: #12493a !important;
    color: white !important;
  }
  .btn_connect:hover {
    opacity: 0.8;
  }

  .btn_disconnect {
    background-color: rgba(255, 64, 64, 0.6) !important;
    color: white !important;
  }
  .btn_disconnect:hover {
    opacity: 0.8;
  }
  .shimmer-effect {
    position: relative;
    overflow: hidden;
    will-change: transform;
  }

  .shimmer-effect::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    animation: shimmer 2s ease-in-out infinite;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(18, 21, 32, 0.5),
      transparent
    );
  }

  @keyframes shimmer {
    0% {
      transform: translateX(-100%);
    }
    100% {
      transform: translateX(100%);
    }
  }

  /* Custom scrollbar for modal description */
  .custom-scrollbar::-webkit-scrollbar {
    width: 6px;
  }

  .custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(45, 45, 45, 0.3);
    border-radius: 8px;
  }

  .custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(
      to bottom,
      rgba(255, 64, 64, 0.4),
      rgba(255, 64, 64, 0.6)
    );
    border-radius: 8px;
    transition: background 0.2s ease;
  }

  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
      to bottom,
      rgba(255, 64, 64, 0.6),
      rgba(255, 64, 64, 0.8)
    );
  }

  /* Firefox scrollbar */
  .custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 64, 64, 0.5) rgba(45, 45, 45, 0.3);
  }

  /* Simplified pricing styles for Twig templates */
  .discount {
    text-decoration: line-through;
    color: rgba(156, 163, 175, 0.7) !important;
    font-size: 0.75rem;
    margin-right: 0.25rem;
  }

  .sale-price {
    color: #ef4444 !important;
    font-weight: 600;
  }

  .regular-price {
    font-weight: 600;
  }

  /* Modal price styling */
  #modal-product-price {
    display: block !important;
    line-height: 1.4;
  }

  /* Sale badge styling */
  .sale-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    letter-spacing: 0.025em;
    animation: pulse-glow 2s infinite;
  }

  @keyframes pulse-glow {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
    50% { transform: scale(1.05); box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3); }
  }

  /* Sales banner styling */
  #sales-banner {
    animation: slide-down 0.5s ease-out;
  }

  @keyframes slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
  }

  /* Product page specific styles */
  .product-actions .add:disabled,
  .product-actions .subscribe:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
    pointer-events: none;
  }

  .product-actions .quantity-display {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-variant-numeric: tabular-nums;
  }

  .product-actions .adjust:active {
    transform: scale(0.9);
  }

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

  /* Hardware acceleration for animations */
  .group:hover img,
  .shimmer-effect,
  button,
  a {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  /* Product description wrapper - supports your custom HTML */
  .product-description-wrapper {
    color: rgba(209, 213, 219, 1);
    line-height: 1.7;
  }

  .product-description-wrapper p {
    margin-bottom: 1em;
    line-height: 1.7;
  }

  .product-description-wrapper strong {
    color: white;
    font-weight: 600;
  }

  .product-description-wrapper em {
    font-style: italic;
  }

  /* Links - gray style */
  .product-description-wrapper a {
    color: rgba(156, 163, 175, 1);
    transition: all 0.2s ease;
  }

  .product-description-wrapper a:hover {
    color: rgba(209, 213, 219, 1);
  }

  .product-description-wrapper a.text-4bit-red {
    color: rgba(255, 64, 64, 1) !important;
  }

  .product-description-wrapper a.text-4bit-red:hover {
    text-decoration: underline !important;
  }

  /* Video/Doc link buttons - EXACT SAME as gift button */
  .product-description-wrapper a.carousel-media {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    height: 2.5rem !important;
    padding: 0 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
    color: white !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: #2d2d2d !important;
    background-color: rgba(23, 25, 38, 1) !important;
    white-space: nowrap !important;
  }

  .product-description-wrapper a.carousel-media:hover {
    background-color: #2d2d2d !important;
    border-color: rgba(255, 64, 64, 1) !important;
  }

  /* Support Tailwind flex utilities */
  .product-description-wrapper .flex {
    display: flex !important;
  }

  .product-description-wrapper .flex-col {
    flex-direction: column !important;
  }

  .product-description-wrapper .w-full {
    width: 100% !important;
  }

  .product-description-wrapper .gap-3 {
    gap: 0.75rem !important;
  }

  /* Feature boxes */
  .product-description-wrapper .bg-\[#1e1e25\] {
    background-color: #1e1e25 !important;
  }

  .product-description-wrapper .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  }

  .product-description-wrapper .p-3 {
    padding: 0.75rem !important;
  }

  .product-description-wrapper .rounded-lg {
    border-radius: 0.5rem !important;
  }

  .product-description-wrapper .border {
    border-width: 1px !important;
    border-style: solid !important;
  }

  .product-description-wrapper .border-\[#1a517d\] {
    border-color: #1a517d !important;
  }

  .product-description-wrapper .border-yellow-400\/30 {
    border-color: rgba(250, 204, 21, 0.3) !important;
  }

  .product-description-wrapper .border-\[#326934\] {
    border-color: #326934 !important;
  }

  .product-description-wrapper .text-blue-400 {
    color: rgb(96, 165, 250) !important;
  }

  .product-description-wrapper .text-yellow-400 {
    color: rgb(250, 204, 21) !important;
  }

  .product-description-wrapper .text-\[#56d55b\] {
    color: #56d55b !important;
  }

  .product-description-wrapper .font-bold {
    font-weight: 700 !important;
  }

  .product-description-wrapper .text-base {
    font-size: 1rem !important;
    line-height: 1.5rem !important;
  }

  .product-description-wrapper .h-\[1px\] {
    height: 1px !important;
  }

  .product-description-wrapper .bg-\[#2d2d2d\] {
    background-color: #2d2d2d !important;
  }

  .product-description-wrapper .pt-4 {
    padding-top: 1rem !important;
  }

  .product-description-wrapper .border-t {
    border-top-width: 1px !important;
    border-top-style: solid !important;
  }

  .product-description-wrapper .border-\[#2d2d2d\] {
    border-color: #2d2d2d !important;
  }

  .product-description-wrapper .text-xs {
    font-size: 0.75rem !important;
    line-height: 1rem !important;
  }

  .product-description-wrapper .text-white\/70 {
    color: rgba(255, 255, 255, 0.7) !important;
  }

  .product-description-wrapper .text-white\/50 {
    color: rgba(255, 255, 255, 0.5) !important;
  }

  .product-description-wrapper .hover\:underline:hover {
    text-decoration: underline !important;
  }

  /* Spacing utilities */
  .product-description-wrapper > div.flex.flex-col {
    margin: 1.5rem 0 !important;
  }

  /* H1 inside feature boxes */
  .product-description-wrapper .flex.flex-col h1 {
    font-size: 1rem !important;
    line-height: 1.5rem !important;
    margin: 0 !important;
  }

  /* Feature box paragraphs */
  .product-description-wrapper .flex.flex-col p {
    margin-bottom: 0.5rem !important;
  }

  .product-description-wrapper .flex.flex-col div.w-full.flex {
    margin-bottom: 0.5rem !important;
  }

  /* Tailwind text utilities */
  .product-description-wrapper.text-sm {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
  }

  .product-description-wrapper.text-gray-200 {
    color: rgb(229, 231, 235) !important;
  }

  .product-description-wrapper.leading-relaxed {
    line-height: 1.625 !important;
  }

  .product-description-wrapper.space-y-2 > * + * {
    margin-top: 0.5rem !important;
  }

  /* Loading skeleton animation */
  @keyframes skeleton-loading {
    0% {
      background-position: 200% 0;
    }
    100% {
      background-position: -200% 0;
    }
  }

  .skeleton {
    background: linear-gradient(
      90deg,
      rgba(45, 45, 45, 0.3) 25%,
      rgba(60, 60, 70, 0.4) 50%,
      rgba(45, 45, 45, 0.3) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
  }
}

@layer utilities {
}
