/* ========================================
   THEMES.CSS - Color and Typography System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

/* ========================================
   DARK THEME (DEFAULT)
   ======================================== */

:root {
  /* Backgrounds */
  --bg: #0C0F14;
  --surface: #141820;
  --surface-2: #1A1F2B;
  --surface-3: #222838;

  /* Borders & Overlays */
  --border: rgba(99, 140, 255, 0.08);
  --border-hover: rgba(99, 140, 255, 0.15);
  --overlay-dim: rgba(0, 0, 0, 0.4);

  /* Accent colors */
  --accent: #7C5CFC;
  --accent-glow: rgba(124, 92, 252, 0.12);
  --accent-soft: rgba(124, 92, 252, 0.06);

  /* Status colors */
  --green: #34D399;
  --green-soft: rgba(52, 211, 153, 0.1);
  --amber: #F59E0B;
  --amber-soft: rgba(245, 158, 11, 0.1);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, 0.1);

  /* Text */
  --text: #E8ECF4;
  --text-secondary: #8B95A8;
  --text-muted: #5A6478;

  /* Context colors */
  --azul-accent: #2E86C1;
  --personal-accent: #C47A2B;
  --personal-glow: rgba(196, 122, 43, 0.12);

  /* Functional */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
}

/* ========================================
   LIGHT THEME
   ======================================== */

body.light-mode {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F5F3F0;
  --surface-3: #EDE8E3;

  --border: rgba(124, 92, 252, 0.1);
  --border-hover: rgba(124, 92, 252, 0.2);
  --overlay-dim: rgba(0, 0, 0, 0.2);

  --accent: #7C5CFC;
  --accent-glow: rgba(124, 92, 252, 0.1);
  --accent-soft: rgba(124, 92, 252, 0.08);

  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.1);
  --amber: #D97706;
  --amber-soft: rgba(217, 119, 6, 0.1);
  --red: #DC2626;
  --red-soft: rgba(220, 38, 38, 0.1);

  --text: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;

  --azul-accent: #2E86C1;
  --personal-accent: #C47A2B;
  --personal-glow: rgba(196, 122, 43, 0.15);
}

/* ========================================
   BASE STYLES
   ======================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background: var(--accent);
  color: white;
}

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

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

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

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

/* ========================================
   UTILITIES
   ======================================== */

.hidden {
  display: none !important;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

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

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

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

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

/* ========================================
   LOADING STATES
   ======================================== */

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  animation: fadeIn 0.3s ease;
}

.loading-spinner::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
}

p {
  font-size: 14px;
  line-height: 1.6;
}

small {
  font-size: 12px;
}

code {
  font-family: 'Courier New', monospace;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ========================================
   BUTTONS
   ======================================== */

button {
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

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

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent), #9A7DFF);
  box-shadow: 0 4px 12px rgba(124, 92, 252, 0.4);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-hover);
}

/* ========================================
   INPUTS & FORMS
   ======================================== */

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder {
  color: var(--text-muted);
}

/* ========================================
   CARDS & SECTIONS
   ======================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* ========================================
   BADGES & LABELS
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.badge-success {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green);
}

.badge-warning {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber);
}

.badge-error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid var(--red);
}

/* ========================================
   MODAL / OVERLAY
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ========================================
   TRANSITIONS
   ======================================== */

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}

.slide-down {
  animation: slideDown 0.3s ease;
}
