/**
 * Liquick Base Styles
 * Reset and fundamental element styles
 */

/* ======================================
 * CSS Reset
 * ====================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ======================================
 * Typography
 * ====================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

strong {
  font-weight: var(--font-semibold);
}

small {
  font-size: var(--text-sm);
}

/* ======================================
 * Lists
 * ====================================== */

ul, ol {
  list-style: none;
}

/* ======================================
 * Images & Media
 * ====================================== */

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  display: inline-block;
  vertical-align: middle;
}

/* ======================================
 * Forms - Base
 * ====================================== */

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input:focus, textarea:focus, select:focus, button:focus {
  outline: none;
}

/* Disable autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--surface-2) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ======================================
 * Tables
 * ====================================== */

table {
  border-collapse: collapse;
  width: 100%;
}

/* ======================================
 * Code
 * ====================================== */

code, pre {
  font-family: var(--font-family-mono);
}

code {
  background-color: var(--surface-2);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
}

pre {
  background-color: var(--surface-1);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

/* ======================================
 * Horizontal Rule
 * ====================================== */

hr {
  border: none;
  border-top: 1px solid var(--border-primary);
  margin: var(--space-6) 0;
}

/* ======================================
 * Selection
 * ====================================== */

::selection {
  background-color: var(--color-primary);
  color: var(--text-inverse);
}

/* ======================================
 * Scrollbar
 * ====================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ======================================
 * Focus Visible
 * ====================================== */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ======================================
 * Utility Classes
 * ====================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error, .text-danger { color: var(--color-error); }
.text-info { color: var(--color-info); }
.text-accent { color: var(--color-primary); }
.text-gain { color: var(--color-gain); }
.text-loss { color: var(--color-loss); }

.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* ======================================
 * Transitions
 * ====================================== */

.transition-all {
  transition: all var(--transition-base);
}

.transition-colors {
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

/* ======================================
 * Animations
 * ====================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(var(--color-primary-rgb), 0.6);
  }
}

.animate-fadeIn { animation: fadeIn var(--transition-base) ease-out; }
.animate-fadeInUp { animation: fadeInUp var(--transition-slow) ease-out; }
.animate-fadeInDown { animation: fadeInDown var(--transition-slow) ease-out; }
.animate-slideInRight { animation: slideInRight var(--transition-slow) ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }

/* ======================================
 * Responsive Visibility Utilities
 * ====================================== */

/* Hide on mobile (below 640px), show on desktop */
.hidden-mobile {
  display: flex;
}

.visible-mobile {
  display: none;
}

@media (max-width: 640px) {
  .hidden-mobile {
    display: none !important;
  }
  
  .visible-mobile {
    display: flex !important;
  }
}
