/* ==========================================================================
   MiConsumoElectrico.casa - Estilos CSS Principales (Light Theme / Fondos Claros)
   ========================================================================== */

:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #e6f4ea;
  --accent: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.2);
  --electric-blue: #0284c7;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dark: #0f172a;

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.2);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--electric-blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #0369a1;
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 65px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none !important;
}

.brand-logo .bolt-icon {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--accent), #eab308);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}

.brand-logo span strong {
  color: var(--electric-blue);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.35rem;
  align-items: center;
}

.nav-links a {
  color: #334155;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--electric-blue);
  background: rgba(2, 132, 199, 0.08);
  text-decoration: none;
}

.nav-links a.active {
  color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.15) !important;
  font-weight: 800 !important;
  border: 1px solid rgba(2, 132, 199, 0.4) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
  text-decoration: none;
}

.btn-calc-nav {
  background: linear-gradient(135deg, var(--primary), #047857);
  color: white !important;
  font-weight: 700 !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-glow);
}

.btn-calc-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(5, 150, 105, 0.4);
}

.btn-calc-nav.active {
  background: linear-gradient(135deg, #047857, #065f46) !important;
  border: 1.5px solid #34d399 !important;
  box-shadow: 0 0 14px rgba(5, 150, 105, 0.5) !important;
}

/* Hero Section */
.hero-section {
  padding: 4rem 0 3rem;
  background: radial-gradient(circle at 50% 20%, rgba(2, 132, 199, 0.07), transparent 75%);
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.25);
  color: var(--accent);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.hero-title span {
  background: linear-gradient(135deg, var(--electric-blue), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #475569;
  max-width: 760px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(5, 150, 105, 0.4);
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #94a3b8;
}

/* Cards & Layout */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  border-color: #0284c7;
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.card-title a {
  color: var(--text-main);
}

.card-title a:hover {
  color: var(--electric-blue);
}

/* Articles */
.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.article-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--electric-blue);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.article-excerpt {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}

/* Interactive Calculator Box */
.calculator-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-lg);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
}

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

.appliance-selector-list {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Scrollbar estilizada */
.appliance-selector-list::-webkit-scrollbar {
  width: 6px;
}
.appliance-selector-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.appliance-item-row {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.appliance-info {
  display: flex;
  flex-direction: column;
}

.appliance-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.appliance-watts {
  font-size: 0.85rem;
  color: var(--accent);
}

.appliance-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hours-slider {
  width: 90px;
  accent-color: var(--primary);
}

.hours-badge {
  background: rgba(2, 132, 199, 0.1);
  color: var(--electric-blue);
  font-weight: bold;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  min-width: 60px;
  text-align: center;
}

/* Results Panel */
.calc-summary-panel {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.summary-metric {
  text-align: center;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.summary-metric-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
}

.summary-metric-val.ars {
  color: var(--accent);
}

.summary-metric-lbl {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Data Table */
.data-table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #ffffff;
}

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

.data-table th, .data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.data-table td {
  color: #334155;
}

.data-table tr:hover {
  background: #f8fafc;
}

.badge-watts {
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent);
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Single Article Styling */
.article-single-header {
  margin-bottom: 2.5rem;
}

.article-single-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 1rem 0;
  line-height: 1.25;
  color: var(--text-main);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #334155;
}

.article-body h2 {
  color: var(--text-main);
  font-size: 1.75rem;
  margin: 2rem 0 1rem;
}

.article-body h3 {
  color: var(--electric-blue);
  font-size: 1.35rem;
  margin: 1.5rem 0 0.75rem;
}

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
  margin: 1rem 0 1.5rem 2rem;
}

/* Footer */
.site-footer {
  background-color: #f1f5f9;
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
  margin-top: auto;
  font-size: 0.9rem;
  color: #475569;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 990px) {
  .navbar {
    height: auto;
    padding: 0.6rem 0;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  text-align: center;
}

/* Admin Dashboard Elements */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ==========================================================================
   Print Stylesheet for Diagnostic PDF Export
   ========================================================================== */
@media print {
  .site-header,
  .site-footer,
  .no-print,
  .hero-section,
  .btn,
  .hours-slider,
  .nav-links,
  #btn-print-pdf,
  #btn-share-wa {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .calculator-box {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .calc-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .calc-summary-panel {
    background: #ffffff !important;
    border: 2px solid #0f172a !important;
    page-break-inside: avoid;
  }
}
