/* ============================================================
   1. CONFIGURATION & VARIABLES
   ============================================================ */
:root {
  --bg-color: #f0f4f8;
  --card-bg: rgba(255, 255, 255, 0.7);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --border-color: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.05);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. DARK MODE OVERRIDES */
body.dark-mode {
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.8);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --accent-blue: #60a5fa;
  --accent-red: #ff6b6b;
  --border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   2. BASE STYLES
   ============================================================ */
body {
  font-family: "Inter", system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-bottom: 80px;
  transition:
    background-color var(--transition),
    color var(--transition);
}

/* ============================================================
   3. HEADER & NAVIGATION
   ============================================================ */
header {
  width: 90%;
  max-width: 1200px;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.logo-accent {
  color: var(--accent-blue);
}

.bulk-badge {
  font-size: 9px;
  background: var(--accent-red);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
  font-weight: 900;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.2);
}

.nav-right {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-right a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s;
}

.nav-right a:hover {
  color: var(--accent-blue);
}

/* THEME SWITCH (SUN/MOON) */
.theme-switch {
  --sw-width: 55px;
  --sw-height: 28px;
  --circle-size: 22px;
  position: relative;
  display: inline-block;
  width: var(--sw-width);
  height: var(--sw-height);
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-canvas {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #83b8ff;
  transition: 0.4s;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.circle {
  position: absolute;
  height: var(--circle-size);
  width: var(--circle-size);
  left: 3px;
  bottom: 3px;
  background-color: #ffce54;
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

input:checked + .slider-canvas {
  background-color: #2c3e50;
}

input:checked + .slider-canvas .circle {
  transform: translateX(27px);
  background-color: #f5f3ce;
  box-shadow: 0 0 10px #f5f3ce;
}

/* ============================================================
   4. MAIN CONTENT & TITLES
   ============================================================ */
main {
  width: 90%;
  max-width: 1100px;
  text-align: center;
  transition: max-width var(--transition);
}

h1 {
  font-weight: 500;
  margin: 40px 0;
  font-size: 2.2rem;
  transition: font-size var(--transition);
}

.sub-text {
  color: var(--text-muted);
  margin-top: -25px;
  margin-bottom: 45px;
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   5. WORKSPACE & GLASS CARDS
   ============================================================ */
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 450px;
  position: relative;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    height 0.3s ease;
}

.glass-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-light);
  text-transform: uppercase;
}

.counter {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 600;
}

/* ============================================================
   6. FORMS, TEXTAREAS & CONTROLS
   ============================================================ */
textarea {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  color: var(--text-main);
  padding: 5px;
}

/* TOGGLE PILLS (Clean Junk, Strip Emojis, etc) */
.toggle-pill {
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 50px;
  display: flex;
  gap: 15px;
  font-size: 12px;
  width: fit-content;
  box-shadow: var(--shadow-sm);
  margin-top: 12px;
  border: 1px solid transparent;
}

body.dark-mode .toggle-pill {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* CUSTOM FILTER BAR */
.custom-filter-bar {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  width: 100%;
}

#customFilter {
  flex: 2;
  min-width: 0;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  transition: var(--transition);
}

#filterMode {
  flex: 1;
  min-width: 155px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 38px 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231e293b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  transition: var(--transition);
}

/* Filter Dark Mode States */
body.dark-mode #customFilter {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode #filterMode {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

body.dark-mode #filterMode option {
  background-color: #1e293b;
  color: #ffffff;
}

/* ============================================================
   7. BUTTONS & ACTIONS
   ============================================================ */
.action-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.mini-btn {
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.mini-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-main);
  border-color: rgba(0, 0, 0, 0.1);
}

.mini-btn.is-active {
  background: var(--accent-blue);
  color: #ffffff !important;
  border-color: var(--accent-blue);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-link {
  background: none;
  border: none;
  color: var(--accent-red);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.action-link:hover {
  opacity: 1;
}

.copy-bar {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  margin-top: 12px;
}

.copy-bar:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Dark Mode Button Overrides */
body.dark-mode .mini-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .mini-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.dark-mode .copy-bar {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .copy-bar:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ============================================================
   8. ADS SECTION
   ============================================================ */
.ads-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 90%;
  max-width: 1100px;
  margin: 40px auto;
}

.glass-ad-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 12px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.glass-ad-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-blue);
}

.ad-tag {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

/* ============================================================
   9. FEEDBACK & TOASTS
   ============================================================ */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--text-main);
  color: var(--bg-color);
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.stats-group {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ============================================================
   10. STATIC CONTENT PAGES (About/Privacy)
   ============================================================ */
.content-page {
  max-width: 800px;
  margin: 40px auto;
  padding: 40px;
  line-height: 1.6;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body.dark-mode .content-page {
  background: rgba(15, 15, 15, 0.7);
  border-color: rgba(255, 255, 255, 0.05);
}

.content-page h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  background: linear-gradient(to right, #ff4e50, #f9d423);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content-page h2 {
  font-size: 1.5rem;
  margin-top: 30px;
  margin-bottom: 15px;
  color: var(--text-color, #333);
  border-left: 4px solid #ff4e50;
  padding-left: 15px;
}

.content-page p {
  margin-bottom: 20px;
  font-size: 1.1rem;
  opacity: 0.9;
}

.content-page ul {
  margin-bottom: 20px;
  padding-left: 20px;
}

.content-page li {
  margin-bottom: 10px;
  list-style-type: square;
}

.back-home {
  display: inline-block;
  margin-top: 30px;
  padding: 10px 20px;
  background: #ff4e50;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  transition: transform 0.2s ease;
}

.back-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 78, 80, 0.4);
}

/* ============================================================
   11. RESPONSIVE QUERIES
   ============================================================ */

/* Large / 4K Monitors */
@media (min-width: 2000px) {
  main {
    max-width: 1600px;
  }
  .glass-card {
    height: 750px;
  }
}

/* Desktop Scale */
@media (min-width: 1440px) {
  main {
    max-width: 1400px;
  }
  .glass-card {
    height: 600px;
    padding: 32px;
  }
  textarea {
    font-size: 18px;
  }
  h1 {
    font-size: 3rem;
  }
  .card-label {
    font-size: 13px;
  }
}

/* Tablets / Small Laptops */
@media (max-width: 900px) {
  .ads-grid-wrapper {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
  }
}

@media (max-width: 850px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .glass-card {
    min-height: 400px;
    height: auto;
  }
  h1 {
    font-size: 1.6rem;
    margin: 20px 0;
  }
}

/* Shorter Screens */
@media (max-height: 800px) and (min-width: 851px) {
  .glass-card {
    height: 350px;
    padding: 18px;
  }
  h1 {
    margin: 20px 0;
    font-size: 1.8rem;
  }
  .ads-grid-wrapper {
    margin-top: 20px;
  }
}

/* Mobile Stacking */
@media (max-width: 600px) {
  .ads-grid-wrapper {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .glass-ad-card {
    min-height: 100px;
  }
}

@media (max-width: 480px) {
  .custom-filter-bar {
    flex-direction: column;
  }
  header {
    flex-direction: column;
    gap: 15px;
  }
}
