:root {
  --bg-primary: #0f1015;
  --bg-secondary: #161822;
  --bg-card: rgba(26, 29, 41, 0.85);
  --bg-card-hover: rgba(35, 39, 56, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --ig-pink: #e1306c;
  --ig-purple: #c13584;
  --ig-orange: #f77737;
  --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --accent-blue: #0095f6;
  --accent-gold: #ffb703;
  --accent-green: #10b981;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(225, 48, 108, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 149, 246, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Header */
.app-header {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 16, 21, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}

.brand .star-icon {
  color: var(--accent-gold);
  font-size: 1.4rem;
  animation: pulse-star 2s infinite ease-in-out;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(255, 183, 3, 0.6)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(255, 183, 3, 0.9)); }
}

.brand-badge {
  background: rgba(225, 48, 108, 0.2);
  color: #ff6b9d;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(225, 48, 108, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  background: var(--ig-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(225, 48, 108, 0.5);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  font-size: 0.85rem;
}

.user-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--ig-pink);
}

/* Container */
.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Hero Section */
.hero-title-area {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 40%, var(--ig-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Input Bar Area (Lizaonair style) */
.input-wrapper-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  margin-bottom: 2rem;
}

.url-input-group {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.url-input-group input {
  flex: 1;
  background: #1e2230;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.url-input-group input:focus {
  border-color: var(--ig-pink);
  box-shadow: 0 0 0 4px rgba(225, 48, 108, 0.2);
}

.start-btn {
  background: var(--accent-blue);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0 2rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.start-btn:hover {
  background: #1877f2;
  box-shadow: 0 4px 15px rgba(0, 149, 246, 0.4);
}

.start-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.demo-link-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.demo-link-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.8rem;
}

/* Filters Card (Lizaonair Purple/Card Style) */
.filter-card {
  background: linear-gradient(135deg, rgba(193, 53, 132, 0.15) 0%, rgba(26, 29, 41, 0.9) 100%);
  border: 1px solid rgba(225, 48, 108, 0.3);
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.filter-header-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.filter-header-title h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ff8ab1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.filter-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-item:hover {
  background: rgba(225, 48, 108, 0.1);
  border-color: rgba(225, 48, 108, 0.3);
}

.filter-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--ig-pink);
  cursor: pointer;
}

.filter-label-group {
  display: flex;
  flex-direction: column;
}

.filter-label-group span.title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.filter-label-group span.desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.advanced-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.input-field-small {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-field-small label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.input-field-small input, .input-field-small select {
  background: #14161f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

/* Post Info Card */
.post-summary-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.4s ease;
}

.post-thumb {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.post-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.post-author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.post-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.post-caption-snippet {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.post-stats-row {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-stats-row b {
  color: #fff;
}

/* Randomizer Drum Arena */
.roulette-arena {
  background: radial-gradient(circle at 50% 50%, #1e162a 0%, #101118 100%);
  border: 2px solid rgba(225, 48, 108, 0.4);
  border-radius: 20px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
  box-shadow: 0 0 50px rgba(225, 48, 108, 0.2);
  position: relative;
  overflow: hidden;
}

.drum-container {
  height: 140px;
  position: relative;
  overflow: hidden;
  margin: 1.5rem auto;
  max-width: 500px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.drum-center-pointer {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 60px;
  transform: translateY(-50%);
  border-top: 2px solid var(--accent-gold);
  border-bottom: 2px solid var(--accent-gold);
  background: rgba(255, 183, 3, 0.08);
  pointer-events: none;
  z-index: 10;
}

.drum-reel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transition: transform 0.1s linear;
}

.drum-slot-item {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.drum-slot-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--ig-pink);
}

.spin-btn {
  background: var(--ig-gradient);
  color: #fff;
  border: none;
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(225, 48, 108, 0.5);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.spin-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 40px rgba(225, 48, 108, 0.7);
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Winner Card (Grand Showcase) */
.winner-card {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.15) 0%, rgba(22, 24, 34, 0.95) 100%);
  border: 2px solid var(--accent-gold);
  border-radius: 20px;
  padding: 2rem;
  margin-top: 2rem;
  animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 15px 50px rgba(255, 183, 3, 0.25);
}

.winner-crown {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.winner-avatar-lg {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  border: 4px solid var(--accent-gold);
  margin-bottom: 0.75rem;
  object-fit: cover;
  box-shadow: 0 0 25px rgba(255, 183, 3, 0.5);
}

.winner-username {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
}

.winner-fullname {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.winner-comment-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-style: italic;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.verification-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.v-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.winner-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-cert {
  background: #10b981;
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-cert:hover {
  background: #059669;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #191c28;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: all 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(15, 16, 21, 0.9);
}

.app-footer a {
  color: var(--ig-pink);
  text-decoration: none;
}

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

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

@media (max-width: 640px) {
  .app-header { padding: 0 1rem; }
  .main-content { padding: 1.5rem 1rem; }
  .url-input-group { flex-direction: column; }
  .start-btn { padding: 0.85rem; justify-content: center; }
  .post-summary-card { flex-direction: column; align-items: center; text-align: center; }
}
