@import "tailwindcss";

/* =============================================
   Pro Code Ads - Global Design System
   ============================================= */

@layer base {
  :root {
    /* Brand Colors */
    --emerald: 16 185 129;       /* #10b981 */
    --emerald-light: 52 211 153; /* #34d399 */
    --emerald-dark: 5 150 105;   /* #059669 */

    /* Background */
    --bg-base: 10 14 25;         /* #0a0e19 */
    --bg-surface: 16 16 16;      /* #101010 */
    --bg-elevated: 22 27 45;     /* #161b2d */
    --bg-card: 18 22 35;         /* #121623 */

    /* Text */
    --text-primary: 184 179 176; /* #b8b3b0 */
    --text-secondary: 138 131 128; /* #8a8380 */
    --text-muted: 75 85 99;      /* #4b5563 */
    --text-bright: 243 244 246;  /* #f3f4f6 */

    /* Borders */
    --border: 55 65 81;          /* #374151 */
    --border-subtle: 31 41 55;   /* #1f2937 */

    /* Shadows */
    --shadow-emerald: 16 185 129;
  }
}

@layer base {
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    background-color: rgb(var(--bg-base));
    color: rgb(var(--text-primary));
    font-family: 'Inter', 'Noto Sans Arabic', sans-serif;
    direction: rtl;
    min-height: 100vh;
  }

  /* RTL Support */
  [dir="ltr"] {
    direction: ltr;
  }

  [dir="rtl"] {
    direction: rtl;
  }

  /* Scrollbar Styling */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: rgb(var(--bg-surface));
  }

  ::-webkit-scrollbar-thumb {
    background: rgb(var(--border));
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--emerald));
  }
}

/* =============================================
   Typography
   ============================================= */
@layer base {
  h1, h2, h3, h4, h5, h6 {
    color: rgb(var(--text-bright));
    font-weight: 700;
    line-height: 1.2;
  }

  p {
    line-height: 1.7;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

/* =============================================
   Animations
   ============================================= */
@layer utilities {
  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  @keyframes pulse-emerald {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  }

  @keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
  }

  @keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }

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

  .animate-float {
    animation: float 3s ease-in-out infinite;
  }

  .animate-pulse-emerald {
    animation: pulse-emerald 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  .animate-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(16,185,129,0.1) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
  }

  .animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
  }
}

/* =============================================
   Glass Effect (Glassmorphism)
   ============================================= */
@layer utilities {
  .glass {
    background: rgba(16, 16, 16, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(55, 65, 81, 0.5);
  }

  .glass-emerald {
    background: rgba(16, 185, 129, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.2);
  }
}

/* =============================================
   Gradient Text
   ============================================= */
@layer utilities {
  .text-gradient-emerald {
    background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .text-gradient-blue-emerald {
    background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

/* =============================================
   NProgress Bar
   ============================================= */
#nprogress {
  pointer-events: none;
}

#nprogress .bar {
  background: #10b981;
  position: fixed;
  z-index: 1600;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

#nprogress .peg {
  display: block;
  position: absolute;
  right: 0;
  width: 100px;
  height: 100%;
  box-shadow: 0 0 10px #10b981, 0 0 5px #10b981;
  opacity: 1;
  transform: rotate(3deg) translate(0px, -4px);
}

/* =============================================
   Dashboard Layout
   ============================================= */
@layer utilities {
  .sidebar-transition {
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .content-transition {
    transition: margin 300ms cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* =============================================
   Card Hover Effects
   ============================================= */
@layer utilities {
  .card-hover {
    transition: all 0.3s ease;
  }

  .card-hover:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
  }
}

/* =============================================
   Reduced Motion
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
