/* master-boilerplate.css */

/* 
 * Antigravity Master Boilerplate - CSS3
 * Ultra-Speed, Zero Dependency, WordPress-Ready
 */

:root {
  /* Professional Light-Mode Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  
  --surface-glass: rgba(255, 255, 255, 0.8);
  --surface-glass-hover: rgba(241, 245, 249, 0.8); 
  --surface-border: #e2e8f0; 
  --surface-border-hover: #cbd5e1; 
  
  --brand-primary: #4f46e5;     /* Professional Indigo Accent */
  --brand-glow: rgba(79, 70, 229, 0.15);
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  
  --grid-gap: 1.5rem;
  --radius-md: 12px;
  --radius-xl: 20px;
  --transition-speed: 0.3s ease;
  
  --container-max: 1280px;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--brand-primary);
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--surface-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.9);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.logo span {
  color: var(--brand-primary);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.main-nav a:hover {
  color: var(--text-main);
}

/* Hero Section */
.hero-section {
  padding: 5rem 0 3rem;
  text-align: center;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Live Search UI */
.search-container {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 99px;
  border: 1px solid var(--surface-border);
  background: var(--surface-glass);
  color: var(--text-main);
  font-size: 1rem;
  backdrop-filter: blur(12px);
  outline: none;
  transition: all var(--transition-speed);
}

.search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Main Layout Grid */
.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  padding: 2rem 0 5rem;
}

@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Category Sidebar */
.category-sidebar {
  position: sticky;
  top: 100px;
  height: max-content;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition-speed);
  border: 1px solid transparent;
}

.category-link:hover,
.category-link.active {
  background: var(--surface-glass);
  color: var(--text-main);
  border-color: var(--surface-border);
}

.category-link.active {
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--grid-gap);
}

/* Tool Card (Glassmorphism) */
.tool-card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: var(--surface-border-hover);
  background: var(--surface-glass-hover);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 15px var(--brand-glow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.03);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border: 1px solid var(--surface-border);
}

.tool-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  letter-spacing: 0.05em;
}

.badge-hot {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.badge-new {
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.tool-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.tool-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
}

.category-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.tool-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tool-link:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--surface-border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Featured Tool (AI Refiner) */
.featured-tool {
  grid-column: 1 / -1; /* Span full width of the grid */
  border-color: var(--brand-primary);
  box-shadow: 0 10px 25px var(--brand-glow);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
}

@media (max-width: 768px) {
  .featured-tool {
    grid-template-columns: 1fr;
  }
}

.featured-tool .tool-meta {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.glow-border {
  display: none;
}

.tool-card.hidden {
  display: none !important;
}

/* ==========================================================================
   Tool-Specific Components (Consolidated for WordPress Enqueue)
   ========================================================================== */

/* Layout: Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 992px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* Tool Panel Base */
.tool-panel, .tool-interface {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.tool-interface {
  margin-bottom: 3rem;
}

.tool-panel h2, .tool-header h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}
.tool-header h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }

.tool-panel p, .tool-header p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.tool-header p { margin-bottom: 0; }

.tool-header { margin-bottom: 1.5rem; }

/* Code Editors / Textareas */
.editor-container, .code-editor-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  margin-bottom: 1.5rem;
}

.editor, .email-editor, .code-editor {
  width: 100%;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
  margin-bottom: 1.5rem;
}

.editor:focus, .email-editor:focus, .code-editor:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2);
}

.code-editor {
  min-height: 350px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.email-editor {
  min-height: 400px;
  margin-bottom: 1rem;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.editor-readonly {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.02);
  cursor: text;
  flex-grow: 1;
  font-family: ui-monospace, monospace;
  color: #a78bfa;
}

/* Tool Actions / Buttons */
.tool-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-speed);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}

.btn-primary:hover {
  background: #7a22cc;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--brand-glow);
}

.btn-secondary {
  background: var(--surface-glass);
  color: var(--text-main);
  border: 1px solid var(--surface-border);
  margin-top: auto;
}
.tool-actions .btn-secondary { margin-top: 0; }

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-glow {
  background: linear-gradient(135deg, #8a2be2, #4f46e5);
  color: #fff;
  position: relative;
  z-index: 1;
  width: 100%;
  font-size: 1.05rem;
  padding: 0.85rem 1.5rem;
}

.btn-glow::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(45deg, #8a2be2, #4f46e5, #ec4899, #8a2be2);
  z-index: -1;
  border-radius: 100px;
  background-size: 400%;
  animation: glowing 20s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.btn-glow:hover::before { opacity: 0.8; }
.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(138, 43, 226, 0.5);
}

@keyframes glowing {
  0% { background-position: 0 0; }
  50% { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

/* Enhancers Grid (AI Refiner) */
.enhancers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.select-box {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' 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 1rem center;
  transition: border-color var(--transition-speed);
}
.select-box:focus { border-color: var(--brand-primary); }
.select-box option { background: var(--bg-primary); color: #fff; }

/* Score Widget (Email Checker) */
.score-widget {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--surface-border);
  margin-bottom: 1.5rem;
}

.score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.8rem;
  color: #fff;
  border: 4px solid var(--surface-border);
  transition: border-color 0.4s ease, color 0.4s ease;
}
.score-circle.good { border-color: #30d158; color: #30d158; }
.score-circle.warning { border-color: #ffd60a; color: #ffd60a; }
.score-circle.danger { border-color: #ff453a; color: #ff453a; }

.score-info h3 { font-size: 1.2rem; margin-bottom: 0.25rem; color: #fff; }
.score-info p { color: var(--text-muted); font-size: 0.9rem; }

.analysis-content { flex-grow: 1; }

.highlighted-preview {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--surface-border);
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}

.highlight-spam {
  background-color: rgba(255, 69, 58, 0.3);
  border-bottom: 2px solid #ff453a;
  border-radius: 2px;
  padding: 0 0.2rem;
  font-weight: 600;
  color: #fff;
}

.alternatives-list { list-style: none; margin-top: 1rem; }
.alt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}
.alt-trigger { color: #ff453a; font-weight: 600; }
.alt-suggestion { color: #30d158; font-weight: 500; }

/* Status Message (n8n Validator) */
.status-message {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: none;
  font-weight: 500;
}
.status-message.success {
  display: block;
  background: rgba(48, 209, 88, 0.1);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.2);
}
.status-message.error {
  display: block;
  background: rgba(255, 69, 58, 0.1);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.2);
}

/* SEO Article Section */
.seo-article {
  max-width: 800px;
  margin: 0 auto 5rem;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 3rem;
}

.seo-article h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #fff;
  margin-top: 0;
}

.seo-article h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #fff;
  margin-top: 2rem;
}

.seo-article p, .seo-article ul {
  margin-bottom: 1.2rem;
  color: var(--text-muted);
}

.seo-article ul {
  padding-left: 1.5rem;
}

.seo-article li {
  margin-bottom: 0.5rem;
}

/* Mobile Sidebar (Pills) */
@media (max-width: 768px) {
  .category-sidebar {
    position: static;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
  .category-list {
    flex-direction: row;
    width: max-content;
  }
  .category-link {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 99px;
  }
}
