@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-dark: #070913;
  --bg-card: rgba(18, 24, 44, 0.75);
  --bg-card-hover: rgba(26, 35, 64, 0.85);
  --bg-input: rgba(13, 18, 34, 0.9);
  --border-color: rgba(99, 102, 241, 0.25);
  --border-focus: rgba(99, 102, 241, 0.8);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-indigo: #6366f1;
  --accent-violet: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.2);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Outfit', 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Background Animated Grid & Orbs */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  animation: floatOrb 15s ease-in-out infinite alternate;
}

.orb-1 {
  width: 450px;
  height: 450px;
  top: -100px;
  left: -100px;
  background: rgba(99, 102, 241, 0.18);
}

.orb-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -100px;
  background: rgba(236, 72, 153, 0.15);
  animation-delay: -5s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.1); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

/* Layout */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-badge i {
  color: var(--accent-cyan);
}

.header h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.header p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* Main Grid Layout */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .app-grid {
    grid-template-columns: 1.2fr 1.8fr;
    align-items: start;
  }
}

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-pink), var(--accent-cyan));
  opacity: 0.8;
}

/* Section Titles */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title i {
  color: var(--accent-indigo);
  font-size: 1.35rem;
}

/* Form Groups */
.form-section {
  margin-bottom: 2.25rem;
}

.form-group {
  margin-bottom: 1.4rem;
}

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-label span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.4rem;
}

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

.input-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
  transition: var(--transition);
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem 0.85rem 2.8rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  background-size: 1rem;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
  background: rgba(18, 25, 48, 0.95);
}

.form-input:focus + .input-icon {
  color: var(--accent-indigo);
}

/* Platform Select Cards */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .platform-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.platform-option {
  position: relative;
  cursor: pointer;
}

.platform-option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.platform-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.platform-card i {
  font-size: 1.6rem;
  transition: var(--transition);
}

.platform-option input:checked + .platform-card {
  color: var(--text-primary);
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5);
}

/* Specific Platform Styles when active */
.platform-option input[value="Instagram"]:checked + .platform-card {
  background: linear-gradient(135deg, rgba(131, 58, 180, 0.2), rgba(253, 29, 29, 0.2), rgba(252, 176, 69, 0.2));
  border-color: #e1306c;
  color: #fff;
}
.platform-option input[value="Instagram"]:checked + .platform-card i { color: #e1306c; }

.platform-option input[value="Facebook"]:checked + .platform-card {
  background: rgba(24, 119, 242, 0.2);
  border-color: #1877f2;
  color: #fff;
}
.platform-option input[value="Facebook"]:checked + .platform-card i { color: #1877f2; }

.platform-option input[value="TikTok"]:checked + .platform-card {
  background: rgba(0, 242, 254, 0.15);
  border-color: #00f2fe;
  color: #fff;
}
.platform-option input[value="TikTok"]:checked + .platform-card i { color: #00f2fe; }

.platform-option input[value="Pinterest"]:checked + .platform-card {
  background: rgba(230, 0, 35, 0.2);
  border-color: #e60023;
  color: #fff;
}
.platform-option input[value="Pinterest"]:checked + .platform-card i { color: #e60023; }

.platform-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Checkbox Toggle */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.checkbox-custom {
  width: 1.35rem;
  height: 1.35rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.35rem;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.checkbox-custom i {
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition);
}

input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
}

input[type="checkbox"]:checked + .checkbox-custom i {
  opacity: 1;
  transform: scale(1);
}

/* Grid for Engagement Minimums & Dates */
.grid-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Execute Button */
.btn-execute {
  width: 100%;
  padding: 1.1rem 1.8rem;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-execute::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-execute:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.65);
}

.btn-execute:hover::after {
  opacity: 1;
}

.btn-execute:active {
  transform: translateY(-1px);
}

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

/* Spinner Overlay & Card */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.modern-spinner {
  width: 64px;
  height: 64px;
  border: 4px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.3);
}

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

.spinner-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.spinner-subtext {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Results Display Area */
.results-card {
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  margin: auto 0;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.4;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.empty-state h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Summary Metrics Banner */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.8rem;
}

@media (min-width: 640px) {
  .stats-banner {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-indigo);
}

.stat-item.approved::after {
  background: var(--accent-emerald);
}

.stat-item.rate::after {
  background: var(--accent-cyan);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.35rem;
}

/* Alert / Banner Box */
.alert-box {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.alert-success i {
  color: var(--accent-emerald);
  font-size: 1.4rem;
  margin-top: 0.1rem;
}

.alert-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.alert-error i {
  color: var(--accent-rose);
  font-size: 1.4rem;
  margin-top: 0.1rem;
}

/* Download Action Box */
.download-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.25);
}

.download-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.download-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1rem 2.2rem;
  background: var(--accent-emerald);
  color: #000;
  font-weight: 800;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
  transition: var(--transition);
}

.btn-download:hover {
  background: #34d399;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.6);
}

/* Interactive Table Preview */
.preview-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.posts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.posts-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.9rem 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.posts-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  vertical-align: middle;
}

.posts-table tr:last-child td {
  border-bottom: none;
}

.posts-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-type.vídeo { background: rgba(6, 182, 212, 0.18); color: #67e8f9; }
.badge-type.imagem { background: rgba(236, 72, 153, 0.18); color: #f9a8d4; }
.badge-type.carrossel { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }

.metric-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.link-post {
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  transition: var(--transition);
}

.link-post:hover {
  color: #a5f3fc;
  text-decoration: underline;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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