/* ===================================================================
   MANUALESDEBOLSA.COM - CLEAN STYLESHEET
   Professional, White-Themed, Fully Responsive Stock Market Portal
   =================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, Cambria, "Times New Roman", Times, serif;
  
  /* White & Clean Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  
  /* Text colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  
  /* Financial Accent Colors */
  --primary: #0284c7;       /* Vibrant trust blue */
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  
  --bull-green: #059669;    /* Market green */
  --bull-light: #d1fae5;
  --bear-red: #dc2626;      /* Market red */
  --bear-light: #fee2e2;
  
  --gold-accent: #d97706;
  --gold-light: #fef3c7;

  /* Borders & Shadows */
  --border-light: #e2e8f0;
  --border-subtle: #edf2f7;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Subtle background grid pattern for clean white look */
.bg-subtle-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(226, 232, 240, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.4) 1px, transparent 1px);
}

/* Ticker Bar */
.ticker-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  contain: paint;
  background-color: #0b1120;
  color: #f8fafc;
  padding: 8px 0;
  font-size: 0.8125rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
}

.ticker-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 0.75rem;
  margin-right: 0.75rem;
  white-space: nowrap;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  z-index: 2;
}

.ticker-content {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll 42s linear infinite;
  will-change: transform;
}

.ticker-content:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 2.25rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.ticker-up {
  color: #34d399;
}
.ticker-down {
  color: #f87171;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Header & Navigation */
.navbar-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.925rem;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  line-height: 1.25;
}

.btn-primary {
  background-color: var(--text-main);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-primary:hover {
  background-color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

.btn-accent {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-accent:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

.btn-outline {
  background-color: #ffffff;
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-secondary);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* Language Switcher */
.lang-switch-wrap {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}

.lang-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.5);
}

.lang-btn.active {
  background-color: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-blue {
  background-color: var(--primary-light);
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-green {
  background-color: var(--bull-light);
  color: var(--bull-green);
  border: 1px solid #a7f3d0;
}

.badge-gold {
  background-color: var(--gold-light);
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-gray {
  background-color: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* Cards */
.card-clean {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card-clean:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-xl);
  transform: translateY(-3px);
}

/* Hero Badge */
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  max-width: 100%;
}

/* Book Cover Mockup */
.book-mockup {
  position: relative;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #0369a1 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform var(--transition-normal);
}

.book-mockup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(to right, rgba(0,0,0,0.4), rgba(255,255,255,0.08), rgba(0,0,0,0.3));
  border-right: 1px solid rgba(255,255,255,0.1);
}

/* Interactive Filter pills */
.pill-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.pill-btn:hover {
  border-color: #94a3b8;
  color: var(--text-main);
}

.pill-btn.active {
  background-color: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

/* Calculator Inputs */
.calc-input-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.calc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.calc-input-prefix, .calc-input-suffix {
  position: absolute;
  color: var(--text-subtle);
  font-size: 0.95rem;
  font-weight: 500;
  pointer-events: none;
}

.calc-input-prefix {
  left: 14px;
}

.calc-input-suffix {
  right: 14px;
}

.calc-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.calc-input.has-prefix {
  padding-left: 2rem;
}

.calc-input.has-suffix {
  padding-right: 2.25rem;
}

.calc-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Range Sliders */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
  margin-top: 6px;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  transition: transform 0.1s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Tabs */
.tab-btn {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-tertiary);
}

.tab-btn.active {
  color: var(--primary);
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #ffffff;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.accordion-item:hover {
  border-color: #cbd5e1;
}

.accordion-header {
  width: 100%;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  gap: 1rem;
}

.accordion-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  color: var(--text-muted);
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.65;
  padding: 0 1.25rem;
}

.accordion-item.open .accordion-body {
  max-height: 400px;
  padding: 0 1.25rem 1.25rem 1.25rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
  position: relative;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 110;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 32px);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Live dot animation */
@keyframes pulseSubtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  animation: pulseSubtle 1.8s infinite;
}

/* Mobile Navigation Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.mobile-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-content {
  width: 82%;
  max-width: 300px;
  height: 100%;
  background: #ffffff;
  padding: 20px;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xl);
}

.mobile-drawer.open .mobile-drawer-content {
  transform: translateX(0);
}

/* Responsive utilities */
@media (max-width: 768px) {
  .desktop-nav {
    display: none !important;
  }
  .mobile-nav-toggle {
    display: flex !important;
  }
}

@media (min-width: 769px) {
  .desktop-nav {
    display: flex !important;
  }
  .mobile-nav-toggle {
    display: none !important;
  }
}
