/**
 * Estilos base compartidos - Inspirados en Instagram
 * Variables CSS y reset base para todas las variantes
 */

:root {
  /* Instagram Colors */
  --ig-primary-background: #ffffff;
  --ig-secondary-background: #fafafa;
  --ig-elevated-background: #ffffff;
  --ig-stroke: #dbdbdb;
  --ig-primary-text: #262626;
  --ig-secondary-text: #8e8e8e;
  --ig-primary-button: #0095f6;
  --ig-primary-button-hover: #1877f2;
  --ig-error: #ed4956;
  --ig-success: #00ba7c;
  --ig-warning: #ffcc02;
  
  /* Instagram Dark Theme */
  --ig-dark-primary-background: #000000;
  --ig-dark-secondary-background: #121212;
  --ig-dark-elevated-background: #262626;
  --ig-dark-stroke: #363636;
  --ig-dark-primary-text: #f5f5f5;
  --ig-dark-secondary-text: #a8a8a8;
  
  /* Spacing (Instagram-like) */
  --ig-space-1: 4px;
  --ig-space-2: 8px;
  --ig-space-3: 12px;
  --ig-space-4: 16px;
  --ig-space-5: 20px;
  --ig-space-6: 24px;
  --ig-space-8: 32px;
  --ig-space-10: 40px;
  --ig-space-12: 48px;
  
  /* Typography */
  --ig-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ig-font-size-xs: 11px;
  --ig-font-size-sm: 12px;
  --ig-font-size-base: 14px;
  --ig-font-size-lg: 16px;
  --ig-font-size-xl: 18px;
  --ig-font-size-2xl: 24px;
  --ig-font-size-3xl: 28px;
  
  /* Border Radius */
  --ig-radius-sm: 3px;
  --ig-radius-base: 6px;
  --ig-radius-lg: 8px;
  --ig-radius-xl: 12px;
  --ig-radius-full: 50%;
  
  /* Shadows */
  --ig-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --ig-shadow-base: 0 1px 6px rgba(0, 0, 0, 0.15);
  --ig-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  
  /* Z-index layers */
  --ig-z-dropdown: 1000;
  --ig-z-sticky: 1020;
  --ig-z-fixed: 1030;
  --ig-z-modal: 1040;
  --ig-z-popover: 1050;
  --ig-z-tooltip: 1060;
}

/* Dark theme variables */
:root.dark-theme {
  --ig-primary-background: var(--ig-dark-primary-background);
  --ig-secondary-background: var(--ig-dark-secondary-background);
  --ig-elevated-background: var(--ig-dark-elevated-background);
  --ig-stroke: var(--ig-dark-stroke);
  --ig-primary-text: var(--ig-dark-primary-text);
  --ig-secondary-text: var(--ig-dark-secondary-text);
}

/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--ig-font-family);
  font-size: var(--ig-font-size-base);
  line-height: 1.5;
  color: var(--ig-primary-text);
  background-color: var(--ig-primary-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Links */
a {
  color: var(--ig-primary-button);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Buttons */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Form elements */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border: 0;
}

/* Lists */
ul,
ol {
  list-style: none;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Utility classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.transition-colors {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.transition-transform {
  transition: transform 0.15s ease;
}

.transition-opacity {
  transition: opacity 0.15s ease;
}

/* Instagram-like loading spinner */
.ig-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ig-stroke);
  border-top: 2px solid var(--ig-primary-button);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Instagram-like button styles */
.ig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--ig-space-2) var(--ig-space-4);
  border-radius: var(--ig-radius-base);
  font-weight: 600;
  font-size: var(--ig-font-size-base);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.ig-btn-primary {
  background-color: var(--ig-primary-button);
  color: white;
}

.ig-btn-primary:hover {
  background-color: var(--ig-primary-button-hover);
  color: white;
}

.ig-btn-secondary {
  background-color: transparent;
  color: var(--ig-primary-text);
  border-color: var(--ig-stroke);
}

.ig-btn-secondary:hover {
  background-color: var(--ig-secondary-background);
  color: var(--ig-primary-text);
}

/* Instagram-like card component */
.ig-card {
  background-color: var(--ig-elevated-background);
  border: 1px solid var(--ig-stroke);
  border-radius: var(--ig-radius-lg);
  overflow: hidden;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Focus styles */
*:focus {
  outline: 2px solid var(--ig-primary-button);
  outline-offset: 2px;
}

button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--ig-primary-button);
  outline-offset: -1px;
}

/* Responsive helpers */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}