/**
 * TopDuoo Custom Styles & Brand Enhancements
 * Optimized for Cloudflare Pages (Free Plan) Static Hosting
 */

:root {
  --topduoo-primary: #e50914;
  --topduoo-primary-hover: #b80710;
  --topduoo-dark: #0f141c;
  --topduoo-surface: #ffffff;
  --topduoo-muted: #64748b;
  --topduoo-border: #e2e8f0;
  --topduoo-radius: 8px;
  --topduoo-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --topduoo-font-heading: 'Plus Jakarta Sans', var(--topduoo-font-sans);
}

body {
  font-family: var(--topduoo-font-sans);
  color: #222934;
  background-color: #f7f9fc;
}

body.newsmatic_dark_mode {
  background-color: #0b0f17;
  color: #cbd5e1;
}

/* Brand Logo Styling */
.topduoo-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--topduoo-font-heading);
  line-height: 1;
}

.topduoo-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #e50914 0%, #ff3b30 100%);
  color: #ffffff;
  border-radius: 10px;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.35);
  letter-spacing: -0.5px;
}

.topduoo-logo-text {
  display: flex;
  flex-direction: column;
}

.topduoo-brand-name {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #0f172a;
}

body.newsmatic_dark_mode .topduoo-brand-name {
  color: #ffffff;
}

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

.topduoo-brand-tagline {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #64748b;
  margin-top: 3px;
}

/* Live Header Top Bar */
.topduoo-topbar {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.newsmatic_dark_mode .topduoo-topbar {
  background: #070a0f;
  border-bottom-color: #1e293b;
}

.topduoo-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Header Promotion Banner */
.topduoo-header-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.topduoo-header-banner .banner-tag {
  background: var(--topduoo-primary);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  margin-right: 10px;
}

.topduoo-header-banner a {
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

/* Navigation Polish */
.main-navigation ul.nav-menu > li > a {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.2px;
  padding: 14px 16px;
  color: #1e293b;
  transition: all 0.2s ease;
}

body.newsmatic_dark_mode .main-navigation ul.nav-menu > li > a {
  color: #e2e8f0;
}

.main-navigation ul.nav-menu > li:hover > a,
.main-navigation ul.nav-menu > li.current-menu-item > a {
  color: var(--topduoo-primary) !important;
}

/* Ticker News Styling */
.ticker-news-wrap {
  background: #ffffff;
  border: 1px solid var(--topduoo-border);
  border-radius: 8px;
  overflow: hidden;
  margin: 15px 0 25px 0;
  display: flex;
  align-items: center;
}

body.newsmatic_dark_mode .ticker-news-wrap {
  background: #131b26;
  border-color: #263345;
}

.ticker-news-wrap .ticker-caption {
  background: var(--topduoo-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  padding: 12px 18px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.ticker-news-wrap .ticker-item-wrap {
  flex-grow: 1;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 600;
}

.ticker-news-wrap .ticker-item-wrap a {
  color: inherit;
  text-decoration: none;
  margin-right: 35px;
  transition: color 0.2s;
}

.ticker-news-wrap .ticker-item-wrap a:hover {
  color: var(--topduoo-primary);
}

/* Live Search Dropdown */
.topduoo-search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  max-height: 420px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  padding: 8px 0;
  margin-top: 8px;
}

body.newsmatic_dark_mode .topduoo-search-results-dropdown {
  background: #17202d;
  border-color: #2b3b52;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.topduoo-search-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

body.newsmatic_dark_mode .topduoo-search-item {
  border-bottom-color: #232f42;
}

.topduoo-search-item:last-child {
  border-bottom: none;
}

.topduoo-search-item:hover {
  background: #f8fafc;
}

body.newsmatic_dark_mode .topduoo-search-item:hover {
  background: #1e293b;
}

.topduoo-search-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.topduoo-search-meta {
  flex-grow: 1;
}

.topduoo-search-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #1e293b;
  margin-bottom: 3px;
}

body.newsmatic_dark_mode .topduoo-search-title {
  color: #f1f5f9;
}

.topduoo-search-date {
  font-size: 11px;
  color: #64748b;
}

/* Category Badge Enhancement */
.topduoo-cat-badge {
  display: inline-block;
  background: var(--topduoo-primary);
  color: #ffffff !important;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.2;
}

.topduoo-cat-technology { background: #2563eb; }
.topduoo-cat-world { background: #059669; }
.topduoo-cat-business { background: #7c3aed; }
.topduoo-cat-science { background: #0891b2; }
.topduoo-cat-sports { background: #ea580c; }
.topduoo-cat-entertainment { background: #db2777; }

/* Filter Tabs on Home Page */
.filter-tab-wrapper .tab-title {
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  background: transparent;
  color: #64748b;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.filter-tab-wrapper .tab-title:hover {
  color: var(--topduoo-primary);
}

.filter-tab-wrapper .tab-title.isActive {
  background: var(--topduoo-primary);
  color: #ffffff;
  border-color: var(--topduoo-primary);
}

/* Single Article Styling */
.topduoo-article-header {
  margin-bottom: 25px;
}

.topduoo-article-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.8px;
  margin: 15px 0;
  color: #0f172a;
}

body.newsmatic_dark_mode .topduoo-article-title {
  color: #f8fafc;
}

.topduoo-author-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-top: 1px solid var(--topduoo-border);
  border-bottom: 1px solid var(--topduoo-border);
  margin-bottom: 25px;
}

body.newsmatic_dark_mode .topduoo-author-card {
  border-color: #2b3b52;
}

.topduoo-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topduoo-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.topduoo-author-name {
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
}

body.newsmatic_dark_mode .topduoo-author-name {
  color: #f1f5f9;
}

.topduoo-author-role {
  font-size: 12px;
  color: #64748b;
}

.topduoo-share-buttons {
  display: flex;
  gap: 8px;
}

.topduoo-share-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  text-decoration: none;
  transition: transform 0.2s;
  cursor: pointer;
  border: none;
}

.topduoo-share-btn:hover {
  transform: translateY(-2px);
}

.topduoo-share-x { background: #000000; }
.topduoo-share-fb { background: #1877f2; }
.topduoo-share-linkedin { background: #0a66c2; }
.topduoo-share-copy { background: #475569; }

/* Article Body Typography */
.topduoo-article-body {
  font-size: 17px;
  line-height: 1.75;
  color: #334155;
}

body.newsmatic_dark_mode .topduoo-article-body {
  color: #cbd5e1;
}

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

.topduoo-article-body h2,
.topduoo-article-body h3 {
  font-family: var(--topduoo-font-heading);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 30px 0 15px;
  color: #0f172a;
}

body.newsmatic_dark_mode .topduoo-article-body h2,
body.newsmatic_dark_mode .topduoo-article-body h3 {
  color: #f8fafc;
}

.topduoo-article-body blockquote {
  border-left: 4px solid var(--topduoo-primary);
  padding: 15px 20px;
  margin: 25px 0;
  background: #f8fafc;
  font-style: italic;
  font-size: 18px;
  color: #1e293b;
  border-radius: 0 8px 8px 0;
}

body.newsmatic_dark_mode .topduoo-article-body blockquote {
  background: #17202d;
  color: #f1f5f9;
}

/* Comments Section */
.topduoo-comments-wrap {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--topduoo-border);
}

body.newsmatic_dark_mode .topduoo-comments-wrap {
  border-color: #2b3b52;
}

.topduoo-comment-item {
  background: #ffffff;
  border: 1px solid var(--topduoo-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

body.newsmatic_dark_mode .topduoo-comment-item {
  background: #17202d;
  border-color: #2b3b52;
}

.topduoo-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.topduoo-comment-author {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

body.newsmatic_dark_mode .topduoo-comment-author {
  color: #f1f5f9;
}

.topduoo-comment-date {
  font-size: 11px;
  color: #64748b;
}

/* Newsletter Widget Card */
.topduoo-newsletter-widget {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
  margin-bottom: 30px;
}

.topduoo-newsletter-widget h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.topduoo-newsletter-widget p {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 18px;
}

.topduoo-newsletter-widget input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #ffffff;
  margin-bottom: 12px;
  font-size: 14px;
}

.topduoo-newsletter-widget button {
  width: 100%;
  background: var(--topduoo-primary);
  color: #ffffff;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.topduoo-newsletter-widget button:hover {
  background: var(--topduoo-primary-hover);
}

/* Toast Message */
.topduoo-toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--topduoo-primary);
  animation: slideInToast 0.3s ease;
}

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

/* Cloudflare Free Plan Badge */
.topduoo-cf-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.topduoo-cf-badge i {
  color: #f38020; /* Cloudflare orange */
}

/* Responsive Menu Drawer Fixes */
@media (max-width: 1024px) {
  .site-header .bb-bldr--normal {
    display: none;
  }
  .site-header .bb-bldr--responsive {
    display: block;
  }
}
@media (min-width: 1025px) {
  .site-header .bb-bldr--responsive {
    display: none;
  }
}
