:root {
  /* Cores da página de vendas */
  --primary: #22c55e;
  --accent: #fb923c;
  --bg: #0b0f14;
  --card: #111827;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --border: #374151;
  --shadow: rgba(0, 0, 0, 0.3);
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
  
  /* Tema claro */
  --bg-light: #ffffff;
  --card-light: #f9fafb;
  --text-light: #111827;
  --text-secondary-light: #6b7280;
  --border-light: #e5e7eb;
  --shadow-light: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] {
  --bg: var(--bg-light);
  --card: var(--card-light);
  --text: var(--text-light);
  --text-secondary: var(--text-secondary-light);
  --border: var(--border-light);
  --shadow: var(--shadow-light);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Login Screen */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-container {
  background: var(--card);
  border-radius: 24px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px var(--shadow);
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  font-size: 2rem;
  font-weight: bold;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  position: relative;
}

.login-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.login-input::placeholder {
  color: var(--text-secondary);
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-btn {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(34, 197, 94, 0.4);
}

.login-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: var(--card);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 2px 10px var(--shadow);
}

.header-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--primary);
}

.back-btn {
  position: absolute;
  left: 1rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 12px;
  display: none;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: var(--border);
}

.back-btn.show {
  display: block;
}

/* Main Content */
.main-content {
  flex: 1;
  padding-bottom: 80px;
}

.page {
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

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

/* Carousel */
.carousel-container {
  margin-bottom: 2rem;
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 8px 32px var(--shadow);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  height: 100%;
}

.module-card {
  min-width: 100%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 27/40;
  background: var(--gradient);
}

.module-image-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.module-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 2rem 1.5rem 1.5rem;
  color: white;
}

.module-overlay h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.module-overlay p {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Carousel Navigation */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}

.carousel-btn {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

/* Consultoria Card */
.consultoria-container {
  margin: 2rem 0;
}

.consultoria-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid transparent;
  background-image: linear-gradient(var(--card), var(--card)), var(--gradient);
  background-origin: border-box;
  background-clip: content-box, border-box;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px var(--shadow);
  position: relative;
}

.consultoria-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
  z-index: 2;
}

.consultoria-card:hover::before {
  left: 100%;
}

.consultoria-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow);
}

.consultoria-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.consultoria-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.consultoria-text-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 2rem 1.5rem 1.5rem;
  color: white;
  text-align: center;
}

.consultoria-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.consultoria-text-overlay h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: white;
}

.consultoria-text-overlay p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.consultoria-badge {
  background: var(--gradient);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  display: inline-block;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}

/* Lessons */
.lessons-container {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.lessons-header {
  margin-bottom: 1.5rem;
}

.lessons-header h2 {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lessons-header p {
  color: var(--text-secondary);
}

.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lesson-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
}

.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--primary);
}

.lesson-card h3 {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.duration {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Player */
.player-container {
  animation: slideIn 0.3s ease;
}

.player-header {
  margin-bottom: 1rem;
}

.player-header h3 {
  font-size: 1.5rem;
  font-weight: bold;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px var(--shadow);
}

.player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6);
}

#youtube-player {
  width: 100%;
  height: 100%;
}

/* Continue Watching */
.continue-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.continue-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
}

.continue-thumb {
  width: 120px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
}

.continue-info {
  flex: 1;
}

.continue-info h3 {
  font-weight: bold;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.continue-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.resume-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.resume-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.cta-btn {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.content-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  transition: all 0.2s ease;
  cursor: pointer;
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--primary);
}

.card-image {
  width: 100%;
  height: 100px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: block;
}

/* Blocked Content Popup */
.blocked-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blocked-popup.show {
  opacity: 1;
}

.blocked-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.blocked-popup-content {
  background: var(--card);
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 60px var(--shadow);
  border: 1px solid var(--border);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.blocked-popup.show .blocked-popup-content {
  transform: scale(1);
}

.blocked-popup-header {
  padding: 1.5rem 1.5rem 1rem;
  text-align: center;
  position: relative;
}

.blocked-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.blocked-popup-header h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blocked-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.blocked-popup-close:hover {
  background: var(--border);
  color: var(--text);
}

.blocked-popup-body {
  padding: 0 1.5rem 1.5rem;
  text-align: center;
}

.blocked-popup-body p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blocked-popup-body p:last-child {
  margin-bottom: 0;
}

.blocked-popup-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.blocked-popup-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.blocked-popup-btn.secondary {
  background: var(--border);
  color: var(--text);
}

.blocked-popup-btn.secondary:hover {
  background: var(--text-secondary);
  color: var(--bg);
}

.blocked-popup-btn.primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.blocked-popup-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.content-card h3 {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.content-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Settings */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-item {
  background: var(--card);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
}

.setting-info h3 {
  font-weight: bold;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.setting-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 28px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Buttons */
.install-btn, .support-btn, .logout-btn {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.logout-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.install-btn:hover, .support-btn:hover, .logout-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 0.5rem;
  display: flex;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -4px 20px var(--shadow);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
  min-width: 60px;
}

.nav-item:hover {
  background: var(--border);
}

.nav-item.active {
  color: var(--primary);
  background: rgba(34, 197, 94, 0.1);
}

.nav-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Responsive */
@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .carousel-nav {
    padding: 0 2rem;
  }
  
  .carousel-btn {
    width: 56px;
    height: 56px;
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .main-content {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .content-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Touch gestures for carousel */

/* Focus states */
button:focus-visible,
.nav-item:focus-visible,
.lesson-card:focus-visible,
.content-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading .pulse {
  animation: pulse 2s infinite;
}