/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #6366f1;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --nav-bg: rgba(15, 23, 42, 0.8);
  --theme-panel-bg: rgba(0, 0, 0, 0.2);
  --theme-panel-border: var(--border-color);
  
  --secondary: #06b6d4;
  --secondary-hover: #0891b2;
  
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  --gradient-glow: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.3), transparent 70%);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.4);

  /* Radius & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(241, 245, 249, 0.9);
  --border-color: rgba(0, 0, 0, 0.08);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #334155;
  
  --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(241,245,249,0.7) 100%);
  --gradient-glow: radial-gradient(circle at 50% -20%, rgba(99, 102, 241, 0.15), transparent 70%);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --nav-bg: rgba(255, 255, 255, 0.88);
  --theme-panel-bg: rgba(241, 245, 249, 0.85);
  --theme-panel-border: rgba(148, 163, 184, 0.28);
}

html[data-theme="light"] body {
  background-color: var(--bg-primary) !important;
}

html[data-theme="light"] .navbar {
  background-color: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .window-header,
html[data-theme="light"] .theme-panel {
  background-color: rgba(241, 245, 249, 0.9) !important;
}

html[data-theme="light"] .theme-panel {
  border-color: rgba(148, 163, 184, 0.28) !important;
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-secondary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Typography Utilities */
h1, h2, h3, h4, h5 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.2;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Glassmorphism Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.875rem;
}

.btn-icon {
  padding: 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Header & Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  transition: var(--transition);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-main);
}

.logo i {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

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

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

/* Hero Section */
.hero {
  padding: 160px 0 100px;
  position: relative;
  overflow: hidden;
  background: var(--gradient-glow);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-badges {
  display: flex;
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-sub);
  font-size: 0.9rem;
}

.badge-item i {
  color: var(--success);
  font-size: 1.2rem;
}

/* Hero Visual Card */
.hero-visual {
  position: relative;
}

.floating-card {
  position: absolute;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  animation: float 6s ease-in-out infinite;
}

.floating-card-1 {
  top: -20px;
  right: -20px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  backdrop-filter: blur(10px);
}

.floating-card-2 {
  bottom: -20px;
  left: -20px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  backdrop-filter: blur(10px);
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Interactive Demos Section */
.demos-section {
  padding: 80px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px;
}

.section-header .tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Demo Tabs */
.demo-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* Demo Container Window */
.demo-window {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
}

.window-header {
  background: var(--theme-panel-bg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.window-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.window-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-content-panel {
  display: none;
  padding: 24px;
  min-height: 520px;
}

.demo-content-panel.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

/* Module Layout Common UI */
.module-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

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

.theme-panel {
  background: var(--theme-panel-bg);
  border: 1px solid var(--theme-panel-border);
  border-radius: var(--radius-sm);
}

/* Status Badges */
.badge-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.status-ok { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-low { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-out { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Grid Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.icon-purple { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: var(--secondary); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.icon-pink { background: rgba(236, 72, 153, 0.15); color: var(--accent); }

.stat-info .num {
  font-size: 1.5rem;
  font-weight: 800;
}

.stat-info .lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* POS Specific Layout */
.pos-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.pos-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.product-item-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.product-item-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.product-item-card h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.product-item-card .price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.pos-cart {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.cart-items {
  flex: 1;
  max-height: 260px;
  overflow-y: auto;
  margin: 16px 0;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-summary {
  border-top: 2px dashed var(--border-color);
  padding-top: 14px;
  margin-top: auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 600;
}

.summary-row.total {
  font-size: 1.3rem;
  color: var(--primary);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 28px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
}

/* Calculator Section */
.calculator-section {
  padding: 80px 0;
  background: var(--bg-secondary);
}

.calc-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  padding: 40px;
}

.calc-options h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.calc-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.calc-option-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.calc-option-btn.included {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.12);
  cursor: not-allowed;
  position: relative;
}

.calc-option-btn.included::after {
  content: 'Incluido';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 8px;
  border-radius: 9999px;
}

.calc-option-btn h4 {
  font-size: 1rem;
}

.calc-option-btn p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calc-result-box {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  text-align: center;
}

.calc-price {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  margin: 20px 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px;
  background: var(--bg-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 0.95rem;
}

.footer-col h4 {
  margin-bottom: 16px;
  font-size: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-buttons {
    justify-content: center;
  }

  .hero-badges {
    justify-content: center;
  }

  .pos-layout {
    grid-template-columns: 1fr;
  }

  .calc-card {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .hero-content h1 {
    font-size: 2.4rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.04);
}
