:root {
  /* Cores Principais */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --secondary-dark: #db2777;
  --accent: #f59e0b;
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  
  /* Neutros */
  --bg-dark: #0f0f23;
  --bg-darker: #0a0a15;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --border: rgba(255, 255, 255, 0.1);
  
  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);
  
  /* Transições */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Tipografia */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-darker);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ========== COMPONENTES GLOBAIS ========== */

.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

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

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-body);
  transition: var(--transition);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

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

.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ========== PÁGINA DE CAPTURA ========== */

.hero-section {
  min-height: 100vh;
  background: var(--bg-darker);
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-hero);
  opacity: 0.1;
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 20s infinite;
}

.hero-bg::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: float 15s infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  position: relative;
  z-index: 1;
}

.hero-content {
  text-align: center;
  margin-bottom: 60px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  animation: slideDown 0.8s ease-out;
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  animation: slideUp 0.8s ease-out;
}

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

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

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  transition: var(--transition);
  animation: fadeIn 0.8s ease-out;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
}

.feature-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.feature-desc {
  color: var(--text-secondary);
  font-size: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Formulário de Registro */
.register-section {
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.register-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  cursor: pointer;
  accent-color: var(--primary);
}

.checkbox-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

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

.photo-preview {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 20px;
  border: 3px solid var(--primary);
  overflow: hidden;
  background: var(--bg-darker);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview img,
.photo-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  font-size: 64px;
  color: var(--text-secondary);
}

.photo-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ========== PÁGINA DO APP (ROLETA/CHAT) ========== */

.app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-darker);
}

.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

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

.mode-toggle {
  display: flex;
  gap: 12px;
  background: var(--bg-darker);
  padding: 6px;
  border-radius: 12px;
}

.mode-btn {
  padding: 10px 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.mode-btn.active {
  background: var(--gradient-primary);
  color: white;
}

.app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ========== ROLETA ========== */

.roulette-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.roulette-card {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 3/4;
  background: var(--bg-card);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  cursor: grab;
  user-select: none;
}

.roulette-card:active {
  cursor: grabbing;
}

.roulette-photo {
  width: 100%;
  height: 70%;
  object-fit: cover;
}

.roulette-info {
  padding: 24px;
  background: linear-gradient(to top, var(--bg-darker), transparent);
  position: absolute;
  bottom: 0;
  width: 100%;
}

.roulette-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.roulette-age {
  font-size: 20px;
  color: var(--text-secondary);
}

.roulette-actions {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.action-btn:hover {
  transform: scale(1.1);
}

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

.action-btn.accept {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* ========== CHAT ========== */

.chat-container {
  height: 100%;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.matches-list {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.match-item {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.match-item:hover {
  background: var(--bg-card-hover);
}

.match-item.active {
  background: rgba(99, 102, 241, 0.1);
  border-left: 3px solid var(--primary);
}

.match-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.match-info {
  flex: 1;
}

.match-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.match-status {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-area {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.messages-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 70%;
  animation: messageSlide 0.3s ease-out;
}

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

.message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.message-bubble {
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.message.sent .message-bubble {
  background: var(--gradient-primary);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}

.message-text {
  margin-bottom: 4px;
}

.message-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.message-input-area {
  padding: 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}

.message-input {
  flex: 1;
}

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

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ========== RESPONSIVO ========== */

@media (max-width: 768px) {
  .chat-container {
    grid-template-columns: 1fr;
  }
  
  .matches-list {
    display: none;
  }
  
  .matches-list.mobile-show {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .register-section {
    padding: 24px;
  }
}

/* ========== UTILIDADES ========== */

.hidden {
  display: none !important;
}

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Esconder boto de voltar em desktop, mostrar apenas em mobile */
#backToMatchesBtn {
  display: none;
}


/* ========== RESPONSIVIDADE MOBILE ========== */

@media (max-width: 768px) {
  .chat-container {
    grid-template-columns: 1fr;
    position: relative;
  }

  /* Por padro em mobile: mostrar lista, esconder chat */
  .matches-list {
    display: block;
    width: 100%;
    height: 100%;
  }

  .chat-area {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    z-index: 20;
  }

  /* Quando chat estiver aberto: esconder lista, mostrar chat */
  .chat-container.chat-open .matches-list {
    display: none;
  }

  .chat-container.chat-open .chat-area {
    display: flex;
  }

  /* Mostrar boto de voltar apenas em mobile */
  #backToMatchesBtn {
    display: flex !important;
  }

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

  .register-section {
    padding: 24px;
  }
}

