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

/* Custom styles */
:root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 248, 250, 252;
  --background-end-rgb: 255, 255, 255;
  --primary: #7c3aed;
  --primary-light: #9867f9;
  --primary-dark: #6027c5;
  --secondary: #10b981;
  --secondary-light: #34d399;
  --secondary-dark: #059669;
  --background: #f8f7ff;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.75rem;
  --transition: 0.3s ease-in-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 10, 15, 25;
    --background-end-rgb: 30, 41, 59;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-elevated: #334155;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    --border: #334155;
  }
}

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

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Open Sans',
    'Helvetica Neue',
    sans-serif;
  color: rgb(var(--foreground-rgb));
  background: linear-gradient(
      to bottom,
      transparent,
      rgb(var(--background-end-rgb))
    )
    rgb(var(--background-start-rgb));
  line-height: 1.6;
  background-image:
    radial-gradient(
      circle at 15% 50%,
      rgba(124, 58, 237, 0.05) 0%,
      transparent 25%
    ),
    radial-gradient(
      circle at 85% 30%,
      rgba(16, 185, 129, 0.05) 0%,
      transparent 25%
    );
  background-attachment: fixed;
  min-height: 100vh;
}

/* Custom component styles */
.counter-component {
  background-color: white;
  border-radius: 0.75rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  transition:
    transform 0.3s ease-in-out,
    box-shadow 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
}

.dark .counter-component {
  background-color: #1e293b;
  color: white;
}

.counter-component .text-gray-800 {
  color: #1f2937;
}

.dark .counter-component .text-gray-800 {
  color: #f9fafb;
}

.counter-component .text-gray-500 {
  color: #6b7280;
}

.dark .counter-component .text-gray-500 {
  color: #9ca3af;
}

.counter-component .bg-gray-50 {
  background-color: #f9fafb;
}

.dark .counter-component .bg-gray-50 {
  background-color: #334155;
}

.counter-component .text-gray-400 {
  color: #9ca3af;
}

.dark .counter-component .text-gray-400 {
  color: #d1d5db;
}

.counter-component .text-indigo-600 {
  color: #4f46e5;
}

.dark .counter-component .text-indigo-600,
.dark .counter-component .text-indigo-400 {
  color: #818cf8;
}

/* Animation for count changes */
.scale-110 {
  transform: scale(1.1);
}

/* Status badge colors */
.bg-green-100 {
  background-color: #dcfce7;
}
.text-green-800 {
  color: #166534;
}

.dark .bg-green-900 {
  background-color: #14532d;
}
.dark .text-green-200 {
  color: #bbf7d0;
}

.bg-red-100 {
  background-color: #fee2e2;
}
.text-red-800 {
  color: #991b1b;
}

.dark .bg-red-900 {
  background-color: #7f1d1d;
}
.dark .text-red-200 {
  color: #fecaca;
}

.bg-gray-100 {
  background-color: #f3f4f6;
}
.text-gray-800 {
  color: #1f2937;
}

.dark .bg-gray-700 {
  background-color: #374151;
}
.dark .text-gray-200 {
  color: #e5e7eb;
}

/* Counter Components */
.counter-container {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  padding: 2.5rem;
  width: 100%;
  max-width: 360px;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto;
}

.counter-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
  transform-origin: left;
}

.counter-container:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.counter-container h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-weight: 700;
  text-align: center;
}

.count-display {
  font-size: 4rem;
  font-weight: 800;
  margin: 1.5rem 0;
  text-align: center;
  color: var(--text-primary);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  padding: 0.5rem 1rem;
  width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.count-display::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  background-color: rgba(0, 0, 0, 0.03);
  opacity: 0.7;
  z-index: -1;
}

.count-display.changing {
  transform: scale(1.2);
}

.store-type-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--primary-light);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  letter-spacing: 0.025em;
  box-shadow: var(--shadow-sm);
}

.button-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.5rem;
}

.button-group button {
  border: none;
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.button-group button:hover {
  background-color: var(--primary-dark);
}

.button-group button:disabled {
  background-color: var(--text-tertiary);
  cursor: not-allowed;
}

/* Ripple effect for buttons */
.button-group button {
  position: relative;
  overflow: hidden;
}

.button-group button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.button-group button:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.getters-section {
  background-color: var(--surface-elevated);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: 100%;
  margin: 1.5rem 0;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.getters-section:before {
  content: 'Getters';
  position: absolute;
  top: -0.75rem;
  left: 1rem;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
}

.getters-section p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.getters-section p:not(:last-child) {
  margin-bottom: 0.75rem;
}

.getters-section strong {
  font-weight: 600;
  color: var(--text-primary);
}

.getters-section span {
  background-color: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 500;
}

button.loading {
  position: relative;
  color: transparent !important;
}

button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 3px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

/* Hero section styling */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  width: 100%;
}

.hero-section h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
  line-height: 1.2;
}

.hero-section .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 1;
}

.footer {
  margin-top: 4rem;
  padding: 1rem;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}
