/* ============================================
   DOMAIN INTELLIGENCE TOOL - DARK DASHBOARD
   Energy Management Design System
   ============================================ */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   COLOR SYSTEM
   ============================================ */
:root {
  /* Backgrounds */
  /* --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-card: #1a1a1a; */
  
  /* Accent */
  /* --accent-green: #c5d5b8;
  --accent-green-dark: #b0c5a3; */

    /* Backgrounds - Dark Blue Theme (like dashboard but darker) */
  --bg-primary: #0a0a1a;        /* Very dark blue-purple */
  --bg-secondary: #131322;      /* Dark blue-purple */
  --bg-card: #1a1a2e;           /* Card dark blue */
  
  /* Accent - Vibrant Purple (like upload button) */
  --accent-primary: #8b5cf6;     /* Vibrant purple */
  --accent-primary-dark: #7c3aed; /* Darker purple hover */
  --accent-primary-light: #a78bfa; /* Lighter purple */
  
  /* Borders */
  /* --border-color: #2a2a2a;
  --border-subtle: #1f1f1f; */

  /* Borders - Purple tint */
  --border-color: #2a2a44;       /* Dark purple-gray */
  --border-subtle: #1f1f33;      /* Darker purple-gray */
  
  /* Text */
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  /* --text-on-accent: #1a1a1a; */
  --text-on-accent: #ffffff;     /* White text on purple */
  
  /* Status Colors */
  --status-success: #4ade80;
  --status-warning: #fbbf24;
  --status-error: #f87171;
  --status-info: #60a5fa;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.header-title,
.card-title,
.mono {
  font-family: 'Space Mono', monospace;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.2;
}

/* ============================================
   DASHBOARD HEADER
   ============================================ */
.dashboard-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  width: 32px;
  height: 32px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.header-title {
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.header-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
}

/* Clocks */
.header-clocks {
  display: flex;
  gap: 2rem;
}

.clock-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.clock-label {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.clock-time {
  font-family: 'Space Mono', monospace;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.dashboard-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
}

/* ============================================
   3-COLUMN DASHBOARD GRID LAYOUT
   ============================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Grid sizes */
.grid-full {
  grid-column: 1 / -1;
}

.grid-third {
  grid-column: span 1;
}

.grid-two-thirds {
  grid-column: span 2;
}

/* ============================================
   ENHANCED CARDS
   ============================================ */

.dark-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dark-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.dark-card.card-accent {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.4);
}

.dark-card.card-accent:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}



/* ============================================
   CARD TITLES
   ============================================ */

.card-title {
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .grid-third,
  .grid-two-thirds {
    grid-column: 1 / -1;
  }
  
  .dark-card {
    padding: 1rem;
  }
}

/* Overview Header */
.overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.overview-title {
  font-family: 'Space Mono', monospace;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
}

.overview-date {
  font-family: 'Space Mono', monospace;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ============================================
   CARDS
   ============================================ */
.dark-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.dark-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.accent-card {
  background: var(--accent-primary );
  color: var(--text-on-accent);
  border: 1px solid var(--accent-primary-dark);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.section-title {
  /* Match .data-label styling exactly */
  font-size: 0.75rem;           /* Same as data-label */
  color: var(--text-muted);     /* Same muted gray */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  
  /* Dark box styling */
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

/* Technology section container - wraps title + badges */
.tech-section-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

/* CMS section with purple accent */
.tech-section-box.cms-accent {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.4);
}

/* Section title inside the box */
.tech-section-box .section-title {
  /* Keep data-label styling */
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.75rem;
  
  /* Remove box styling (now on parent) */
  background: none;
  border: none;
  padding: 0;
}

/* Technology badges container */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section {
  margin-bottom: 2rem;
}

.search-input-group {
  display: flex;
  gap: 1rem;
}

.search-input {
  flex: 1;
  background: var(--bg-primary) !important;  /* Force dark background */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  color: var(--text-primary) !important;  /* Force white text */
  transition: all 0.2s ease;
  cursor: text;
  -webkit-appearance: none;  /* Remove browser defaults */
  -moz-appearance: none;
  appearance: none;
}

.search-input:focus {
  outline: none;
  background: var(--bg-primary) !important;  /* Keep dark on focus */
  border-color: var(--accent-primary);  /* Purple border */
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);  /* Purple glow */
}

.search-input::placeholder {
  color: var(--text-muted);
  opacity: 1;  /* Ensure placeholder is visible */
}

/* Fix autocomplete styling */
.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-primary) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-primary) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.search-button {
  background: var(--accent-primary);  /* Purple ✅ */
  cursor: pointer;  /* Correct ✅ */
}

.search-button:hover {
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);  /* Purple ✅ */
}


.search-button {
  background: var(--accent-primary);  /* Purple */
  color: var(--text-on-accent);
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  font-family: 'Inter', sans-serif;  /* Changed from Space Mono */
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;  /* This is correct */
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;  /* For glow effect */
}

.search-button:hover {
  background: var(--accent-primary-dark);  /* Dark purple */
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);  /* Purple shadow */
}

.search-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* Purple glow effect */
.search-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  padding: 2px;
  background: linear-gradient(45deg, #8b5cf6, #a78bfa);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.2s;
}

.search-button:hover::before {
  opacity: 0.5;
}

.search-button:active {
  transform: translateY(0);
}

.search-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */
.loading-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.error-container {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--status-error);
  border-radius: var(--radius-md);
  color: var(--status-error);
  font-size: 0.875rem;
}

/* Subdomain Banner */
.subdomain-banner {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid var(--status-warning);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.banner-icon {
  width: 20px;
  height: 20px;
  color: var(--status-warning);
  flex-shrink: 0;
}

.subdomain-banner strong {
  color: var(--status-warning);
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.subdomain-banner p {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* ============================================
   DATA DISPLAY
   ============================================ */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.data-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.data-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.data-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  word-break: break-word;
}

.data-value.mono {
  font-family: 'Space Mono', monospace;
  font-size: 0.8125rem;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-success {
  background: rgba(74, 222, 128, 0.1);
  color: var(--status-success);
  border: 1px solid var(--status-success);
}

.status-warning {
  background: rgba(251, 191, 36, 0.1);
  color: var(--status-warning);
  border: 1px solid var(--status-warning);
}

.status-error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--status-error);
  border: 1px solid var(--status-error);
}

.status-info {
  background: rgba(96, 165, 250, 0.1);
  color: var(--status-info);
  border: 1px solid var(--status-info);
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */
.collapsible-header {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collapsible-header:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-green);
}

.collapsible-content {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.chevron {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.chevron.rotate {
  transform: rotate(180deg);
}

/* ============================================
   SSL COLLAPSIBLE SECTIONS
   ============================================ */

.ssl-collapsible-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ssl-collapsible-header {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.ssl-collapsible-header:hover {
  background: rgba(139, 92, 246, 0.05);
}

.ssl-chevron {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
  transition: transform 0.2s ease;
}

.ssl-chevron.rotate {
  transform: rotate(180deg);
}

.ssl-collapsible-content {
  padding: 0 1rem 1rem 1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.dashboard-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  text-align: center;
  margin-top: 4rem;
}

.dashboard-footer p {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .dashboard-main {
    padding: 1.5rem;
  }
  
  .data-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-main {
    padding: 1rem;
  }
  
  .header-container {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .header-clocks {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }
  
  .clock-item {
    align-items: center;
  }
  
  .clock-time {
    font-size: 1.25rem;
  }
  
  .header-title {
    font-size: 1.25rem;
  }
  
  .search-input-group {
    flex-direction: column;
  }
  
  .search-button {
    width: 100%;
  }
  
  .data-grid {
    grid-template-columns: 1fr;
  }
  
  .overview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .dashboard-header {
    padding: 1rem;
  }
  
  .header-title {
    font-size: 1rem;
  }
  
  .header-tagline {
    font-size: 0.6875rem;
  }
  
  .clock-time {
    font-size: 1rem;
  }
}