*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #4cc9f0;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --success: #7209b7;
  --border-radius: 16px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

body {
  background-color: #f5f7fb;
  color: var(--dark);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Main App */
.app-container {
  min-height: 100vh;
}

.header {
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  position: relative;
}

.app-logo {
  height: 35px;
}

.main-content {
  padding: 30px 0;
}

.page-title {
  font-size: 32px;
  margin-bottom: 8px;
  color: #5a5d63;
  font-weight: 700;
}

.page-subtitle {
  color: #4a5568;
  margin-bottom: 30px;
  font-size: 16px;
}

.roleplay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.roleplay-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.roleplay-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.roleplay-card.locked {
  opacity: 0.8;
  cursor: not-allowed;
}

.roleplay-card.locked:hover {
  transform: none;
}

.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(2px);
}

.locked-overlay i {
  margin-right: 8px;
}

.card-image {
  height: 160px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 42px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.card-content {
  padding: 24px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--dark);
  min-height: 24px;
}

.card-description {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
  flex-grow: 1;
  min-height: 40px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray);
  margin-top: auto;
}

.difficulty {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
  background: #4361ee;
  color: white;
  margin-right: 8px;
}

/* ============================================ */
/* ORIGINAL FILTER CONTAINER - WORKING AND CENTERED */
/* ============================================ */

.filter-container {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.filter-toggle {
  display: flex;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  gap: 2px;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 40px auto;
}

.filter-btn {
  padding: 12px 24px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #6b7280;
  position: relative;
  overflow: hidden;
  min-width: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.filter-btn:hover::before {
  left: 100%;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #4361ee;
  transform: translateY(-1px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
  color: white;
  box-shadow: 
      0 4px 15px rgba(67, 97, 238, 0.3),
      0 2px 4px rgba(67, 97, 238, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.filter-btn.active:hover {
  background: linear-gradient(135deg, #3a56d4 0%, #2f4bc2 100%);
  transform: translateY(-2px);
  box-shadow: 
      0 6px 20px rgba(67, 97, 238, 0.4),
      0 3px 6px rgba(67, 97, 238, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .filter-toggle {
      padding: 4px;
      border-radius: 14px;
      width: auto;
      margin-bottom: 35px;
  }
  
  .filter-btn {
      padding: 10px 16px;
      font-size: 13px;
      min-width: 80px;
      border-radius: 10px;
  }
  
  /* ADD THESE LINES FOR MOBILE SEARCH BUTTONS */
  .search-buttons {
      flex-direction: column;
      align-items: center;
  }
  
  .search-type-btn, #clearSearchBtn {
      width: 100%;
      max-width: 300px;
      justify-content: center;
  }
}

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

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  width: 95%;
  height: 90%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray);
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.close-modal:hover {
  background: #e9ecef;
  color: var(--dark);
}

.modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
  min-height: 500px;
}

.iframe-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iframe-container iframe {
  width: 100%;
  height: 70vh;
  min-height: 550px;
  border: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

#iframeContainer iframe {
  width: 100%;
  height: 70vh;
  min-height: 550px;
  border-radius: 8px;
}

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 15px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  width: 100%;
  letter-spacing: 0.5px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
  background: var(--gray);
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: #5a08a3;
}

/* Free and Premium tags */
.free-tag {
  color: #dc2626;
  font-weight: 600;
  font-size: 11px;
}

.premium-tag {
  color: #7c3aed;
  font-weight: 600;
  font-size: 11px;
}

.accent-tag {
  background: #e9ecef;
  color: #6c757d;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .roleplay-grid {
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 20px;
  }
  
  .page-title {
      font-size: 28px;
  }
}

@media (max-width: 576px) {
  .roleplay-grid {
      grid-template-columns: 1fr;
  }
  
  .payment-content {
      padding: 30px 25px;
      margin: 20px;
  }
}

/* Type tags */
.type-tag {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
}

.roleplay-tag {
  background: #e3f2fd;
  color: #1976d2;
}

.pronounce-tag {
  background: #f3e5f5;
  color: #7b1fa2;
}

.listen-tag {
  background: #e8f5e9;
  color: #2e7d32;
}

.speak-tag {
  background: #fff3e0;
  color: #e65100;
}

/* Premium unlocked styles */
.premium-unlocked-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
}

.premium-unlocked-tag {
  color: #FFA500;
  font-weight: 600;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ============================================ */
/* DICTIONARY WIDGET STYLES - SIMPLE IFRAME */
/* ============================================ */

.dict-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
}

/* Toggle Button - Circular Magnifying Glass */
.dict-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  z-index: 10000;
}

.dict-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(67, 97, 238, 0.6);
}

.dict-toggle:active {
  transform: scale(0.95);
}

/* Iframe Container */
.dict-iframe-container {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 400px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.dict-iframe-container.active {
  display: flex;
  animation: slideUp 0.3s ease;
}

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

/* Close Button */
.dict-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background 0.3s ease;
}

.dict-close:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Iframe */
#dictIframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .dict-widget {
      bottom: 20px;
      right: 20px;
  }
  
  .dict-toggle {
      width: 55px;
      height: 55px;
      font-size: 22px;
  }
  
  .dict-iframe-container {
      width: 320px;
      height: 450px;
      bottom: 65px;
  }
}

@media (max-width: 480px) {
  .dict-iframe-container {
      width: 280px;
      height: 400px;
      right: -10px;
  }
}

/* ============================================ */
/* SCROLL INDICATOR - SOLID DARK, TOP, PULSE GLOW */
/* ============================================ */

.scroll-indicator {
  position: fixed;
  top: 30px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 1001;
  pointer-events: none;
  display: none;
}

.scroll-indicator.active {
  display: block;
  animation: fadeInDown 0.5s ease;
}

.scroll-text {
  background: rgba(23, 211, 10, 0.891); /* Solid dark - no fading edges */
  color: white;
  padding: 10px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  /* PULSE GLOW EFFECT - no backdrop-filter */
  animation: pulseGlow 2s infinite;
}

.scroll-text i {
  font-size: 12px;
  opacity: 0.9;
}

/* Animation for top position */
@keyframes fadeInDown {
  0% { 
      opacity: 0; 
      transform: translateY(-20px); 
  }
  100% { 
      opacity: 1; 
      transform: translateY(0); 
  }
}

/* PULSE GLOW - only affects box-shadow, no backdrop blur */
@keyframes pulseGlow {
  0%, 100% { 
      box-shadow: 0 0 0 0 rgba(244, 236, 7, 0.924); 
  }
  50% { 
      box-shadow: 0 0 15px 5px rgba(214, 226, 1, 0.454); 
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .scroll-indicator {
      top: 20px;
  }
  
  .scroll-text {
      font-size: 13px;
      padding: 8px 18px;
  }
}

/* ============================================ */
/* PAYMENT MODAL - FULLY RESPONSIVE WITH COLORS */
/* ============================================ */

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

.payment-content {
  background: white;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 550px;
  padding: 30px 25px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin: 20px;
}

/* Desktop/Laptop - wider layout */
@media (min-width: 768px) {
  .payment-content {
      max-width: 600px;
      padding: 35px 30px;
  }
  
  .payment-content > div:first-of-type {
      display: flex;
      gap: 15px;
      justify-content: center;
  }
  
  .payment-content > div:first-of-type > div {
      flex: 1;
      min-width: 200px;
  }
}

/* Tablet - stacked but with more space */
@media (min-width: 481px) and (max-width: 767px) {
  .payment-content {
      max-width: 500px;
      padding: 25px 20px;
  }
}

/* Mobile - single column, scroll if needed */
@media (max-width: 480px) {
  .payment-content {
      padding: 20px 15px;
      max-height: 90vh;
      overflow-y: auto;
  }
  
  .payment-content > div:first-of-type > div {
      padding: 12px !important;
      margin-bottom: 10px;
  }
  
  .payment-content h3 {
      font-size: 16px;
      margin: 5px 0;
  }
  
  .payment-content p {
      font-size: 12px;
      margin: 5px 0;
  }
  
  .payment-content .btn {
      padding: 10px;
      font-size: 14px;
  }
}

/* Lifetime option - Gold theme */
.payment-content > div:first-of-type > div:first-child {
  border: 2px solid #FFD700;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 12px;
  padding: 15px;
}

.payment-content > div:first-of-type > div:first-child h3 {
  color: #FFD700;
  margin: 10px 0 5px;
}

.payment-content > div:first-of-type > div:first-child i {
  color: #FFD700;
  font-size: 24px;
}

.payment-content > div:first-of-type > div:first-child .btn {
  background: #FFD700;
  color: #333;
  font-weight: 700;
  border: none;
  width: 100%;
  margin-top: 10px;
}

.payment-content > div:first-of-type > div:first-child .btn:hover {
  background: #ffed4a;
  transform: translateY(-2px);
}

/* Subscription option - Blue theme */
.payment-content > div:first-of-type > div:last-child {
  border: 2px solid #4361ee;
  background: rgba(67, 97, 238, 0.05);
  border-radius: 12px;
  padding: 15px;
}

.payment-content > div:first-of-type > div:last-child h3 {
  color: #4361ee;
  margin: 10px 0 5px;
}

.payment-content > div:first-of-type > div:last-child i {
  color: #4361ee;
  font-size: 24px;
}

.payment-content > div:first-of-type > div:last-child .btn {
  background: #4361ee;
  color: white;
  border: none;
  width: 100%;
  margin-top: 10px;
}

.payment-content > div:first-of-type > div:last-child .btn:hover {
  background: #5a67d8;
  transform: translateY(-2px);
}

/* Warning text */
.payment-content .lifetime-warning {
  color: #dc3545;
  font-size: 12px;
  font-weight: 600;
  margin: 5px 0;
}

.payment-content .subscription-note {
  color: #28a745;
  font-size: 12px;
  font-weight: 600;
  margin: 5px 0;
}

/* Price text */
.payment-content .price {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin: 5px 0;
}

.payment-content .price small {
  font-size: 14px;
  font-weight: normal;
}

/* Description text */
.payment-content .description {
  font-size: 13px;
  color: var(--gray);
  margin: 5px 0 10px;
}