/* GrantPing - Clean, Modern Styles */
/* Sepia/Beige Theme Only */

:root, [data-theme="light"], [data-theme="dark"], [data-theme="system"] {
  --primary: #166534;
  --primary-dark: #14532d;
  --primary-light: #22c55e;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #EFE0D0;
  --bg-secondary: #F8EBE0;
  --border: #C19A6B;
  --text: #000000;
  --text-secondary: #5A5A5A;
  --shadow: none;
  --shadow-lg: none;
}

/* Force sepia theme - no dark mode */
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --primary: #166534;
    --primary-dark: #14532d;
    --primary-light: #22c55e;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #EFE0D0;
    --bg-secondary: #F8EBE0;
    --border: #C19A6B;
    --text: #000000;
    --text-secondary: #5A5A5A;
    --shadow: none;
    --shadow-lg: none;
  }
}

  /* Backgrounds (Surface Hierarchy) */
  --bg: #0F172A;                /* Canvas - page background (Slate-950) */
  --bg-secondary: #1E293B;      /* Surface - cards, panels (Slate-900) */
  --bg-elevated: #334155;       /* Elevated - modals, dropdowns (Slate-700) */

  /* Text (Opacity-based hierarchy) */
  --text: #F1F5F9;              /* 87% white - primary text (Slate-100) */
  --text-secondary: #94A3B8;    /* 60% white - secondary text (Slate-400) */
  --text-disabled: #64748B;     /* 38% white - disabled/hints (Slate-500) */

  /* Borders (Subtle, minimal) */
  --border: rgba(255, 255, 255, 0.12);  /* Default borders */
  --border-emphasis: #475569;           /* Stronger borders (Slate-600) */

  /* Semantic Colors (Lightened for dark backgrounds) */
  --secondary: #94A3B8;
  --success: #4ADE80;           /* Green-400 - bright enough to stand out */
  --danger: #F87171;            /* Red-400 - accessible contrast */
  --warning: #FBBF24;           /* Amber-400 - highly visible */

  /* Shadows (Nearly invisible, use elevation instead) */
  --shadow: 0 0 0 transparent;
  --shadow-lg: 0 0 0 transparent;
}

/* System preference when theme is "system" */
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    /* Same as dark theme - GrantPing colors */
    --primary: #4ade80;
    --primary-dark: #22c55e;
    --primary-light: #86efac;
    --bg: #0F172A;
    --bg-secondary: #1E293B;
    --bg-elevated: #334155;
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-disabled: #64748B;
    --border: rgba(255, 255, 255, 0.12);
    --border-emphasis: #475569;
    --secondary: #94A3B8;
    --success: #4ADE80;
    --danger: #F87171;
    --warning: #FBBF24;
    --shadow: 0 0 0 transparent;
    --shadow-lg: 0 0 0 transparent;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* EasyPing Top Bar */
.easyping-bar {
  background: #1e293b;
  color: white;
  font-size: 0.75rem;
  padding: 6px 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.easyping-bar a {
  color: white;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.easyping-bar a:hover {
  opacity: 1;
}

.easyping-bar a.active {
  opacity: 1;
  font-weight: 600;
}

.easyping-brand {
  font-weight: 600;
  margin-right: 0.5rem;
}

.easyping-sep {
  opacity: 0.4;
}

/* Product colors as underlines or dots */
.easyping-bar a.govping.active { border-bottom: 2px solid #2563eb; }
.easyping-bar a.regping.active { border-bottom: 2px solid #ea580c; }
.easyping-bar a.grantping.active { border-bottom: 2px solid #16a34a; }

/* Header */
header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

/* Sonar ping on the "i" dot */
.ping-i {
  position: relative;
  display: inline-block;
}
.ping-i::before,
.ping-i::after {
  content: '';
  position: absolute;
  top: 0.25em;
  left: 46%;
  transform: translateX(-50%);
  width: 0.3em;
  height: 0.3em;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.5;
  animation: sonar-ping 3s ease-out infinite;
}
.ping-i::after {
  animation-delay: 0.4s;
}
@keyframes sonar-ping {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 0.6;
  }
  30% {
    transform: translateX(-50%) scale(2.5);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) scale(2.5);
    opacity: 0;
  }
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Stats Row */
.stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: white;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Cards */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

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

.card-header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* Sample Alerts */
.sample-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sample-title {
  font-weight: 600;
  color: var(--primary);
  flex: 1;
  min-width: 200px;
}

.sample-title a {
  color: inherit;
  text-decoration: none;
}

.sample-title a:hover {
  text-decoration: underline;
}

.sample-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sample-dept {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.sample-summary {
  color: var(--text);
  margin-bottom: 0.75rem;
}

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

.sample-goodfor strong {
  color: var(--primary);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s, background-color 0.2s;
  height: 48px;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--text);
}

.form-input[type="text"],
.form-input[type="email"] {
  line-height: normal;
}

select.form-input {
  cursor: pointer;
}

.form-input::placeholder {
  color: #94a3b8;  /* Lighter gray for placeholders in light mode */
  opacity: 0.6;
}

[data-theme="dark"] .form-input::placeholder {
  color: var(--text-disabled);
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] .form-input::placeholder {
    color: var(--text-disabled);
    opacity: 1;
  }
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Checkboxes */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.checkbox-label:hover {
  border-color: var(--primary);
  background: var(--bg-secondary);
}

.checkbox-label input {
  margin-right: 0.5rem;
}

.checkbox-label input:checked + span {
  color: var(--primary);
  font-weight: 600;
}

/* Tags */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--primary);
  background: var(--bg);
}

.tag.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 6px;
}

/* Tags (for Good For items in modal) */
.tag {
  display: inline-block;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-right: 4px;
  margin-bottom: 4px;
}

.badge-success, .badge-low {
  background: #dcfce7;
  color: #166534;
}

.badge-warning, .badge-medium {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger, .badge-high {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info, .badge-small-biz {
  background: #dbeafe;
  color: #1e40af;
}

/* Dark mode badge inversions */
[data-theme="dark"] .badge-success,
[data-theme="dark"] .badge-low {
  background: #166534;
  color: #dcfce7;
}

[data-theme="dark"] .badge-warning,
[data-theme="dark"] .badge-medium {
  background: #92400e;
  color: #fef3c7;
}

[data-theme="dark"] .badge-danger,
[data-theme="dark"] .badge-high {
  background: #991b1b;
  color: #fee2e2;
}

[data-theme="dark"] .badge-info,
[data-theme="dark"] .badge-small-biz {
  background: #1e40af;
  color: #dbeafe;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] .badge-success,
  [data-theme="system"] .badge-low {
    background: #166534;
    color: #dcfce7;
  }

  [data-theme="system"] .badge-warning,
  [data-theme="system"] .badge-medium {
    background: #92400e;
    color: #fef3c7;
  }

  [data-theme="system"] .badge-danger,
  [data-theme="system"] .badge-high {
    background: #991b1b;
    color: #fee2e2;
  }

  [data-theme="system"] .badge-info,
  [data-theme="system"] .badge-small-biz {
    background: #1e40af;
    color: #dbeafe;
  }
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text);
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Loading */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Pricing */
.pricing-card {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.pricing-amount {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
}

.pricing-period {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.pricing-features {
  text-align: left;
  list-style: none;
  margin: 2rem 0;
}

.pricing-features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
  border-bottom: none;
}

/* CTA Section */
.cta-section {
  background: var(--primary);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: white;
}

.cta-section p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-section .btn {
  background: white;
  color: var(--primary);
}

.cta-section .btn:hover {
  background: var(--bg-secondary);
}

/* Footer */
footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 1rem;
}

footer a:hover {
  text-decoration: underline;
}

/* Carousel */
.carousel-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.carousel-slide {
  display: none;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  max-width: 100%;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid var(--border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.carousel-arrow:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
}

.carousel-prev { left: -60px; }
.carousel-next { right: -60px; }

.carousel-dots {
  text-align: center;
  margin-top: 1.5rem;
}

.carousel-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 5px;
  background: var(--primary);
  opacity: 0.3;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.2s;
}

.carousel-dot.active {
  opacity: 1;
}

/* Utilities */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .stats {
    gap: 2rem;
  }

  .carousel-prev { left: 10px; }
  .carousel-next { right: 10px; }

  .nav-links {
    gap: 1rem;
  }
}

/* Simple Layout Grid */
#contractsList {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 900px) {
    #contractsList {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Responsive filters */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr !important;
    }

    /* Make modal full-screen on mobile */
    #modalOverlay > div {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        padding: 1.5rem !important;
    }
}
