/* ==========================================
   TURINGTECH - App Pages Styles
   Based on turingtech_style_guide + dark theme
   ========================================== */

:root {
  --color-primary: #050C1F;
  --color-secondary: #111E3D;
  --color-accent: #FF6B00;
  --color-accent-hover: #E05E00;
  --color-dark: #0B1528;
  --color-gray: #64748B;
  --color-light: #F1F5F9;
  --color-white: #FFFFFF;
  --color-text: #94A3B8;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-neon-orange: 0 0 20px rgba(255, 107, 0, 0.35);
}

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

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: #050C1F;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(11, 30, 68, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(17, 30, 61, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 100%, rgba(8, 18, 40, 0.7) 0%, transparent 60%),
    linear-gradient(180deg, #050C1F 0%, #060E22 40%, #050C1F 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Orbes de luz flotantes en el fondo */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.bg-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.15) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  animation: orbFloat1 20s ease-in-out infinite;
}
.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(30, 64, 175, 0.18) 0%, transparent 70%);
  bottom: 10%;
  left: -100px;
  animation: orbFloat2 25s ease-in-out infinite;
}
.bg-orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation: orbFloat3 30s ease-in-out infinite;
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, 80px) scale(1.1); }
  66% { transform: translate(40px, -40px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, -60px) scale(1.15); }
  66% { transform: translate(-30px, 40px) scale(0.9); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-30%, -60%) scale(1.2); }
}

/* Grid sutil de fondo */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
}

/* Canvas de partículas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
}

/* Glassmorphism */
.glass-panel {
  background: rgba(11, 22, 49, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #050C1F; }
::-webkit-scrollbar-thumb { background: #111E3D; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #FF6B00; }

/* ==========================================
   LAYOUT
   ========================================== */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  position: relative;
  z-index: 10;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 22, 49, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  max-width: 100%;
  padding: 0;
  margin-bottom: 0;
}

.app-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.app-header-logo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(255, 107, 0, 0.3);
}

.app-header-logo .brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  font-family: 'Barlow', sans-serif;
  color: white;
}

.app-header-logo .subbrand {
  font-size: 11px;
  color: #FF6B00;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-top: 2px;
  display: block;
}

.app-header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-header-nav a {
  color: var(--color-gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.app-header-nav a:hover {
  color: var(--color-accent);
}

/* ==========================================
   CARDS / PANELS
   ========================================== */
.glass-panel {
  background: rgba(11, 22, 49, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card {
  background: rgba(17, 30, 61, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 107, 0, 0.2);
  box-shadow: 0 10px 30px -10px rgba(255, 107, 0, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-header h3 {
  font-family: 'Barlow', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-white);
  margin: 0;
}

.card-header i {
  font-size: 20px;
  color: var(--color-accent);
}

/* ==========================================
   FORMS
   ========================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-light);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  background-color: rgba(5, 12, 31, 0.6);
  border: 2px solid rgba(100, 116, 139, 0.2);
  border-radius: var(--radius-md);
  font-family: inherit;
  color: var(--color-white);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input::placeholder {
  color: var(--color-gray);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.form-input.error {
  border-color: var(--color-error);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input {
  cursor: pointer;
}

select.form-input option {
  background: var(--color-secondary);
  color: var(--color-white);
}

.form-required-marker {
  color: var(--color-error);
  margin-left: 4px;
}

.error-message {
  display: block;
  margin-top: 6px;
  color: var(--color-error);
  font-size: 14px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.btn-primary:hover {
  box-shadow: var(--shadow-neon-orange);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background-color: #1a2e5a;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

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

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

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

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-large {
  padding: 16px 32px;
  font-size: 18px;
}

.btn-block {
  width: 100%;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--color-warning);
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--color-info);
}

.alert i {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  color: white;
}

.badge-success { background-color: var(--color-success); }
.badge-warning { background-color: var(--color-warning); color: var(--color-primary); }
.badge-error { background-color: var(--color-error); }
.badge-info { background-color: var(--color-info); }
.badge-accent { background-color: var(--color-accent); }
.badge-secondary { background-color: var(--color-secondary); }

/* ==========================================
   TABLES
   ========================================== */
.table-container {
  overflow-x: auto;
}

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

.table thead {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(224, 94, 0, 0.15));
}

.table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 14px;
}

.table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================
   CREDIT DISPLAY
   ========================================== */
.credit-balance {
  text-align: center;
  padding: 32px;
}

.credit-balance .label {
  font-size: 14px;
  color: var(--color-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.credit-balance .amount {
  font-family: 'Barlow', 'Inter', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1;
}

.credit-balance .subtitle {
  font-size: 14px;
  color: var(--color-gray);
  margin-top: 8px;
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: rgba(17, 30, 61, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
  cursor: pointer;
}

.notification-item:hover {
  background: rgba(17, 30, 61, 0.7);
}

.notification-item.unread {
  border-left: 3px solid var(--color-accent);
}

.notification-item .notif-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.notification-item .notif-icon.success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.notification-item .notif-icon.error { background: rgba(239, 68, 68, 0.15); color: var(--color-error); }
.notification-item .notif-icon.info { background: rgba(59, 130, 246, 0.15); color: var(--color-info); }
.notification-item .notif-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }

.notification-item .notif-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-white);
  margin: 0 0 4px 0;
}

.notification-item .notif-content p {
  font-size: 13px;
  color: var(--color-gray);
  margin: 0;
}

.notification-item .notif-time {
  font-size: 12px;
  color: var(--color-gray);
  margin-top: 4px;
}

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--color-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: 'Barlow', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-white);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-gray);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================
   TABS
   ========================================== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  font-family: inherit;
}

.tab:hover {
  color: var(--color-light);
}

.tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ==========================================
   GRID
   ========================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ==========================================
   TEXT HELPERS
   ========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-gray { color: var(--color-gray); }
.text-white { color: var(--color-white); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ==========================================
   AUTH PAGES (login, register)
   ========================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px 20px;
  position: relative;
  z-index: 10;
}

.auth-card {
  background: rgba(11, 22, 49, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-neon-orange);
}

.auth-logo h1 {
  font-family: 'Barlow', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--color-white);
  margin: 12px 0 4px 0;
}

.auth-logo p {
  font-size: 14px;
  color: var(--color-accent);
  font-weight: 600;
  margin: 0;
}

.auth-title {
  font-family: 'Barlow', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--color-gray);
  margin-bottom: 24px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-gray);
}

.auth-footer a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-incentive {
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.auth-incentive .credits {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-accent);
}

.auth-incentive .text {
  font-size: 14px;
  color: var(--color-light);
  margin-top: 4px;
}

/* ==========================================
   SPINNER
   ========================================== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .app-header-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .auth-card {
    padding: 24px;
  }

  .credit-balance .amount {
    font-size: 36px;
  }

  .table {
    font-size: 12px;
  }

  .table th, .table td {
    padding: 8px 10px;
  }
}
