/* ============================================================
   DataPowerDemand.com - Dark Theme Stylesheet
   ============================================================ */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-input: #1e2435;
  --border-color: #2a3040;
  --border-light: #374151;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-primary: #3b82f6;
  --accent-secondary: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-purple: #8b5cf6;
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-success: linear-gradient(135deg, #10b981, #059669);
  --gradient-warning: linear-gradient(135deg, #f59e0b, #d97706);
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: #60a5fa; text-decoration: underline; }
img { max-width: 100%; height: auto; }
ul, ol { padding-left: 1.5rem; }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-logo:hover { text-decoration: none; color: var(--accent-primary); }
.site-logo .logo-icon { font-size: 1.5rem; }
.logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: -2px;
}
.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.main-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.main-nav a:hover, .main-nav a.active {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom-color: var(--accent-primary);
}
.nav-cta {
  background: var(--gradient-primary);
  color: #fff !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: var(--radius-sm);
  border-bottom: none !important;
  font-weight: 600;
}
.nav-cta:hover { opacity: 0.9; color: #fff !important; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* ===== MAIN CONTENT ===== */
.site-main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-col h4 { color: var(--text-primary); font-size: 0.95rem; margin-bottom: 1rem; }
.footer-col p, .footer-col a { color: var(--text-muted); font-size: 0.85rem; line-height: 1.8; }
.footer-col a:hover { color: var(--accent-primary); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== HERO ===== */
.hero-section {
  text-align: center;
  padding: 4rem 1rem;
  background: radial-gradient(ellipse at top, rgba(59,130,246,0.08), transparent 70%);
}
.hero-section h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 1rem; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-section p { font-size: 1.15rem; color: var(--text-secondary); max-width: 700px; margin: 0 auto 2rem; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
}
.card:hover { border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ===== STATS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.form-input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-family);
  transition: var(--transition);
}
.form-input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
textarea { min-height: 120px; resize: vertical; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  font-family: var(--font-family);
}
.btn-primary { background: var(--gradient-primary); color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; text-decoration: none; }
.btn-success { background: var(--gradient-success); color: #fff; }
.btn-success:hover { opacity: 0.9; color: #fff; text-decoration: none; }
.btn-warning { background: var(--gradient-warning); color: #fff; }
.btn-danger { background: var(--accent-danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== BLOG ===== */
.blog-card { margin-bottom: 1.5rem; }
.blog-card .card-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.blog-card .card-title a { color: var(--text-primary); }
.blog-card .card-title a:hover { color: var(--accent-primary); text-decoration: none; }
.blog-meta { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.75rem; }
.blog-meta span { margin-right: 1rem; }
.blog-excerpt { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }
.blog-category {
  display: inline-block;
  background: rgba(59,130,246,0.15);
  color: var(--accent-primary);
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===== ARTICLE (blog post) ===== */
.article { max-width: 800px; margin: 0 auto; }
.article h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin-bottom: 0.75rem; }
.article h2 { font-size: 1.6rem; font-weight: 700; margin: 2rem 0 0.75rem; color: var(--text-primary); }
.article h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--text-primary); }
.article p { margin-bottom: 1rem; color: var(--text-secondary); line-height: 1.8; font-size: 1.05rem; }
.article ul, .article ol { margin-bottom: 1rem; color: var(--text-secondary); }
.article li { margin-bottom: 0.4rem; }
.article blockquote {
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(59,130,246,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.article strong { color: var(--text-primary); }
.article .table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.article th, .article td {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border-color);
  text-align: left;
}
.article th { background: var(--bg-card); color: var(--text-primary); font-weight: 600; }
.article td { color: var(--text-secondary); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
}
.pagination a, .pagination span {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.pagination a:hover { border-color: var(--accent-primary); color: var(--accent-primary); text-decoration: none; }
.pagination .current { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }
.pagination .disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== ALERTS ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-danger { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.alert-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }
.alert-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.page-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.page-subtitle { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: 2rem; }

/* ===== MISC ===== */
.page-content { max-width: 800px; margin: 0 auto; }
.page-content p { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.8; }
.page-content h2 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.page-content ul, .page-content ol { color: var(--text-secondary); margin-bottom: 1rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-green { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-red { background: rgba(239,68,68,0.15); color: #f87171; }

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.gap-1 { gap: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== ADMIN DASHBOARD ===== */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
}
.admin-sidebar h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1.5rem; }
.admin-nav { list-style: none; padding: 0; }
.admin-nav li { margin-bottom: 0.25rem; }
.admin-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
  background: rgba(59,130,246,0.1);
  color: var(--accent-primary);
  text-decoration: none;
}
.admin-main { padding: 2rem; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-section h1 { font-size: 1.8rem; }
  .article h1 { font-size: 1.5rem; }
  .site-main { padding: 1.25rem; }
  .main-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .main-nav.open { display: flex; flex-direction: column; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--bg-secondary); padding: 1rem; border-bottom: 1px solid var(--border-color); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes gaugeFill {
    from { width: 0 !important; }
    to { width: var(--target); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes countUp {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.signal-card {
    animation: fadeInUp 0.6s ease both;
}
.signal-card:nth-child(1) { animation-delay: 0.1s; }
.signal-card:nth-child(2) { animation-delay: 0.2s; }
.signal-card:nth-child(3) { animation-delay: 0.3s; }
.signal-card:nth-child(4) { animation-delay: 0.4s; }
.signal-card:nth-child(5) { animation-delay: 0.5s; }

.stat-value {
    animation: countUp 0.8s ease both;
}

.hero-title {
    animation: fadeInUp 0.8s ease both;
}
.hero-subtitle {
    animation: fadeInUp 0.8s ease 0.2s both;
}
.hero-actions {
    animation: fadeInUp 0.8s ease 0.4s both;
}

.gauge-fill {
    animation: gaugeFill 1.5s ease-out both;
}
