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

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #121824;
  --bg-card: rgba(22, 30, 49, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.4);
  
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.15);
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 8px 30px rgba(16, 185, 129, 0.1);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-green);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: #34d399;
  text-decoration: underline;
}

/* Glassmorphism Panel Utilities */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none !important;
}

.logo span {
  background: linear-gradient(135deg, var(--accent-green), #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
}

nav {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.nav-link.active {
  border-bottom: 2px solid var(--accent-green);
  border-radius: 8px 8px 0 0;
  background: transparent;
}

.nav-link-btn {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #fff !important;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.nav-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* Button UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, #10b981, #047857);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Custom Toggle Switch */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 24px;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-published {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-draft {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-scheduled {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* --- DASHBOARD STYLES --- */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
  margin-bottom: 30px;
}

.stat-card {
  padding: 24px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 28px;
  font-family: var(--font-heading);
  font-weight: 800;
  margin-bottom: 4px;
}

.stat-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.main-content-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
}

.card-body {
  padding: 24px;
}

/* Console Logger System */
.console-box {
  background: #06090f;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #a7f3d0;
  padding: 16px;
  height: 250px;
  overflow-y: auto;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.console-line {
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-all;
}

.console-timestamp {
  color: var(--text-muted);
  margin-right: 8px;
}

/* Niches Checkboxes Grid */
.niches-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.niche-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Table Design */
.table-container {
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.post-row-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.post-row-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.actions-cell {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Modal Window */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

/* --- PUBLIC CONSUMER BLOG STYLES --- */

/* Hero banner */
.blog-hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
}

.blog-hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-hero p {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 30px;
}

.search-bar-wrapper {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-bar {
  width: 100%;
  background: rgba(22, 30, 49, 0.6);
  border: 1px solid var(--border-color);
  padding: 14px 14px 14px 48px;
  border-radius: 30px;
  color: white;
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: var(--transition-fast);
}

.search-bar:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

/* Filter Tags Layout */
.filter-tabs-wrapper {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-tab:hover, .filter-tab.active {
  background: var(--accent-green-glow);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

/* Card layout grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.blog-card-image {
  height: 200px;
  background: linear-gradient(135deg, #1f2937, #111827);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  position: relative;
}

.blog-card-image::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg-secondary), transparent);
}

.blog-card-image svg {
  width: 48px;
  height: 48px;
  opacity: 0.8;
  filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.2));
}

.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.blog-card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
}

.blog-card-tags {
  display: flex;
  gap: 6px;
}

.blog-card-tag {
  font-size: 11px;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.read-more-link {
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.read-more-link svg {
  transition: transform var(--transition-fast);
}

.read-more-link:hover svg {
  transform: translateX(4px);
}

/* Consumer Article Reading Panel */
.reader-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  margin-top: 40px;
  margin-bottom: 80px;
}

.article-content-wrapper {
  padding: 40px;
}

.article-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 30px;
}

.article-meta-info {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.article-title {
  font-size: 38px;
  line-height: 1.25;
  margin-bottom: 16px;
}

.article-body {
  font-size: 16px;
  color: #d1d5db;
  line-height: 1.8;
}

.article-body p {
  margin-bottom: 24px;
}

.article-body h3 {
  font-size: 22px;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 16px;
}

.article-body h4 {
  font-size: 18px;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 12px;
}

.article-body ul, .article-body ol {
  margin-bottom: 24px;
  padding-left: 20px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  border-left: 4px solid var(--accent-green);
  background: rgba(16, 185, 129, 0.04);
  padding: 16px 20px;
  margin: 30px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 15px;
}

/* Styled Affiliate Links in Content */
.affiliate-link {
  font-weight: 600;
  color: var(--accent-green);
  border-bottom: 1px dashed var(--accent-green);
  padding-bottom: 1px;
}

.affiliate-link:hover {
  color: #34d399;
  border-bottom-style: solid;
  text-decoration: none;
}

/* Sidebar Utilities */
.sidebar-widget {
  padding: 24px;
  margin-bottom: 24px;
}

.widget-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.widget-list {
  list-style: none;
}

.widget-item {
  margin-bottom: 12px;
}

.widget-item-link {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.widget-item-link:hover {
  color: var(--accent-green);
  text-decoration: none;
}

.widget-item-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Floating Reading Progress Bar */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1001;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--accent-green), var(--accent-blue));
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Newsletter CTA Card */
.newsletter-cta {
  background: linear-gradient(135deg, rgba(22, 30, 49, 0.8), rgba(16, 185, 129, 0.05));
  text-align: center;
  padding: 48px;
  margin: 60px 0;
}

.newsletter-cta h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.newsletter-cta p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 24px;
  font-size: 15px;
}

.newsletter-form {
  display: flex;
  max-width: 450px;
  margin: 0 auto;
  gap: 10px;
}

/* Back Link styling */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 20px;
}

.back-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* Responsive Grid styling overrides */
@media(max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-content-layout {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .reader-layout {
    grid-template-columns: 1fr;
  }
}

@media(max-width: 600px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .blog-hero h1 {
    font-size: 34px;
  }
}
