@import '@fortawesome/fontawesome-free/css/all.min.css';
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --font-inter: ShopifyInter, "Noto Sans Arabic", "Noto Sans Hebrew", ui-sans-serif, system-ui, sans-serif;

    /* ==========================================================================
       SHOPIFY POLARIS NEUTRAL TOKENS (Black / White / Grey)
       Strictly follows Shopify App Design Guidelines & Built for Shopify standards
       ========================================================================== */
    --theme-color: #303030;
    --theme-color-hover: #1a1a1a;
    --theme-color-light: #f6f6f7;
    --theme-color-border: #e1e3e5;
    --theme-color-rgb: 48 48 48;

    /* Aliases for universal components */
    --primary-color: var(--theme-color);
    --primary-hover: var(--theme-color-hover);
    --primary-light: var(--theme-color-light);
  }

  * {
    font-family: var(--font-inter);
  }

  body {
    font-family: var(--font-inter);
    background-color: #f1f1f1;
    color: #303030;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-inter);
    letter-spacing: -0.015em;
    color: #202223;
  }

  /* Minimal Sober FontAwesome Icons */
  i[class*="fa-"], i[class*="fa "] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    font-style: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Custom modern sleek scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Standardized Shopify Polaris Design System utility classes */
@layer utilities {
  /* Cards & Containers */
  .polaris-card {
    @apply bg-white rounded-2xl border border-slate-200/90 shadow-[0_1px_3px_rgba(0,0,0,0.03),0_4px_12px_-2px_rgba(0,0,0,0.04)] p-4 sm:p-6 transition-all duration-200;
  }

  .app-card {
    @apply bg-white rounded-2xl border border-slate-200/90 shadow-[0_1px_3px_rgba(0,0,0,0.03),0_4px_12px_-2px_rgba(0,0,0,0.04)] transition-all duration-200;
  }
  
  .app-card-hover {
    @apply hover:border-slate-300 hover:shadow-[0_4px_20px_-4px_rgba(0,0,0,0.07)] hover:-translate-y-0.5 transition-all duration-200;
  }

  /* Form Elements */
  .polaris-input {
    @apply w-full px-3.5 py-2 text-xs md:text-sm bg-white border border-slate-300 rounded-xl text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900 transition-all duration-150;
  }

  .polaris-select {
    @apply w-full px-3.5 py-2 text-xs md:text-sm bg-white border border-slate-300 rounded-xl text-slate-900 focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900 transition-all duration-150 cursor-pointer;
  }

  /* Buttons */
  .btn-primary, .polaris-btn-primary {
    @apply inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl font-semibold text-xs sm:text-sm bg-theme text-white hover:bg-theme-hover active:scale-[0.985] shadow-sm transition-all duration-150 cursor-pointer disabled:opacity-50 disabled:pointer-events-none;
  }

  .btn-theme {
    @apply inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl font-semibold text-xs sm:text-sm bg-theme text-white hover:bg-theme-hover active:scale-[0.985] shadow-sm transition-all duration-150 cursor-pointer disabled:opacity-50 disabled:pointer-events-none;
  }

  .btn-theme-light {
    @apply inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl font-semibold text-xs sm:text-sm bg-theme-light text-theme border border-theme-border hover:bg-white active:scale-[0.985] shadow-2xs transition-all duration-150 cursor-pointer disabled:opacity-50 disabled:pointer-events-none;
  }

  .btn-secondary, .polaris-btn-secondary {
    @apply inline-flex items-center justify-center gap-2 px-3.5 py-2.5 rounded-xl font-semibold text-xs sm:text-sm bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 hover:border-slate-300 active:scale-[0.985] shadow-2xs transition-all duration-150 cursor-pointer disabled:opacity-50 disabled:pointer-events-none;
  }

  .btn-accent, .polaris-btn-blue {
    @apply inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl font-semibold text-xs sm:text-sm bg-theme text-white hover:bg-theme-hover active:scale-[0.985] shadow-sm shadow-theme/20 transition-all duration-150 cursor-pointer disabled:opacity-50 disabled:pointer-events-none;
  }

  .btn-emerald, .polaris-btn-success {
    @apply inline-flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl font-semibold text-xs sm:text-sm bg-emerald-600 text-white hover:bg-emerald-700 active:scale-[0.985] shadow-sm shadow-emerald-500/20 transition-all duration-150 cursor-pointer disabled:opacity-50 disabled:pointer-events-none;
  }

  .btn-danger, .polaris-btn-danger {
    @apply inline-flex items-center justify-center gap-2 px-3.5 py-2.5 rounded-xl font-semibold text-xs sm:text-sm bg-rose-600 text-white hover:bg-rose-700 active:scale-[0.985] shadow-sm transition-all duration-150 cursor-pointer disabled:opacity-50 disabled:pointer-events-none;
  }

  .btn-ghost, .polaris-btn-ghost {
    @apply inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded-xl font-medium text-xs text-slate-600 hover:text-slate-900 hover:bg-slate-100 transition-colors cursor-pointer;
  }

  /* Badges & Status Pills */
  .badge-pill {
    @apply inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-bold tracking-tight shadow-2xs;
  }

  .polaris-badge-theme {
    @apply inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-theme/10 text-theme border border-theme/20;
  }

  .polaris-badge-emerald {
    @apply inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200/70;
  }

  .polaris-badge-blue {
    @apply inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-theme/10 text-theme border border-theme/20;
  }

  .polaris-badge-amber {
    @apply inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-amber-50 text-amber-700 border border-amber-200/70;
  }

  .polaris-badge-rose {
    @apply inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-rose-50 text-rose-700 border border-rose-200/70;
  }

  .polaris-badge-slate {
    @apply inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-slate-100 text-slate-700 border border-slate-200/80;
  }

  /* Direct CSS Variable Theme Utilities */
  .bg-theme {
    background-color: var(--theme-color) !important;
  }
  .bg-theme-hover {
    background-color: var(--theme-color-hover) !important;
  }
  .bg-theme-light {
    background-color: var(--theme-color-light) !important;
  }
  .text-theme {
    color: var(--theme-color) !important;
  }
  .border-theme {
    border-color: var(--theme-color) !important;
  }
  .border-theme-border {
    border-color: var(--theme-color-border) !important;
  }
  .accent-theme {
    accent-color: var(--theme-color) !important;
  }

  .focus-ring {
    @apply focus:outline-none focus:ring-2 focus:ring-slate-900/10 focus:border-slate-900 transition-all;
  }
}

/* Subtle button interactive animation */
button:active:not(:disabled), a:active:not(:disabled) {
  transform: scale(0.985);
}


