/* styles.css - Semantic, fast, no Tailwind */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');


.hidden {
  display: none;
}

@media (min-width: 768px) {
  .md\:block {
    display: block;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: #f9fafb;
  color: #111827;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* === Layout === */
.container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 1rem;
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }

/* === Grid === */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* === Typography === */
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-md { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-white { color: #ffffff; }
.text-primary { color: #00d084; }
.text-accent { color: #4fc3f7; }
.text-dark { color: #0a192f; }
.text-positive { color: #00d084; }
.text-negative { color: #dc2626; }
.text-red-600 { color: #dc2626; }
.text-red-500 { color: #ef4444; }
.text-red { color: #dc2626; }

/* === Backgrounds === */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-dark { background-color: #0a192f; }
.bg-primary { background-color: #00d084; }
.bg-accent { background-color: #4fc3f7; }

/* === Borders & Shadows === */
.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.border { border: 1px solid #d1d5db; }

/* === Spacing === */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }

/* === Buttons & Links === */
.btn-primary {
  background: #00d084;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  display: inline-block;
}
.btn-primary:hover {
  background: #00b06d;
}

/* === Header === */
.header {
  background: #0a192f;
  color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.header-logo {
  font-size: 1.5rem;
  font-weight: 700;
}
.header-logo span:first-child { color: #00d084; }
.header-logo span:last-child { color: #4fc3f7; font-style: italic; }
.trust-bar {
  background: #1e293b;
  text-align: center;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-top: 1px solid #334155;
}
.trust-bar strong { color: white; }
.trust-bar .rating { color: #4ade80; font-weight: 600; }

/* === Navigation === */
.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
}
.nav-list li {
  position: relative;
}
.nav-link {
  display: block;
  padding: 0.5rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.2s;
}
.nav-link:hover {
  color: #00d084;
}
.submenu {
  display: none;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  padding: 0.5rem;
  min-width: 220px;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
}
.submenu.show { display: block; }
.submenu a {
  display: block;
  padding: 0.5rem 1rem;
  color: #1f2937;
  font-weight: normal;
}
.submenu a:hover {
  background: #e5e7eb;
}
.pro-badge {
  background: #eab308;
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  margin-left: 0.5rem;
}

/* === Mobile === */
/* --- Mobile Hamburger Animation --- */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-menu-toggle span {
  display: block;
  width: 1.5rem;
  height: 1px;
  background: white;
  margin: 0.375rem 0;
}
@media (min-width: 768px) {
  .mobile-menu-toggle { display: none; }
  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .submenu {
    display: none;
  }
  .nav-list li:hover .submenu {
    display: block;
  }
}

/* === Cards === */
.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1.5rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 1.125rem;
  font-weight: 700;
}
.card-desc {
  font-size: 0.875rem;
  color: #6b7280;
}

/* === Lists === */
.list-disc {
  list-style: disc;
  padding-left: 1.25rem;
}
.list-item {
  margin-bottom: 1rem;
}
.list-link {
  font-weight: 600;
  color: #4b5563;
}
.list-link:hover {
  text-decoration: underline;
}

/* === Ads === */
.ad-container {
  margin: 1rem auto;
  text-align: center;
}
.adsbygoogle {
  display: block !important;
}

/* === Footer === */
.footer {
  background: #0a192f;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}
.footer a {
  color: #93c5fd;
}
.footer a:hover {
  text-decoration: underline;
}

/* === Meme Breakout Flash === */
.meme-flash {
  animation: flash 1.5s infinite;
}
@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.meme-red { color: #dc2626 !important; }
.meme-green { color: #00d084 !important; }

/* === Meme Breakout Meter === */
.bg-red-600 { background-color: #dc2626; }
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.ring-2 { box-shadow: 0 0 0 0.3rem rgba(251,191,36,0.6); }
.ring-yellow-400 { /* border ring effect simulated above */ }
.border-2 { border: 2px solid; }
.border-yellow-400 { border-color: #fbbf24; }

/* Additional styling for meme-meter card */
.meme-meter-card {
  text-align: center;
}
.meme-meter-card .status-btn {
  font-size: 1.125rem;
  font-weight: 600;
  min-width: 200px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse {
    animation: none;
  }
}

/* === Finviz Screeners Page === */
.screener-hero {
  background: linear-gradient(to bottom, #1e3a8a, #3b82f6);
  color: white;
  padding: 3rem 1rem;
  text-align: center;
}
.screener-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.screener-hero p {
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  opacity: 0.95;
}
.screener-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1rem;
}
.screener-btn {
  display: block;
  background: #1e40af;
  color: white;
  padding: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.screener-btn:hover {
  background: #1e3a8a;
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-color: #60a5fa;
}

@media (max-width: 768px) {
  .screener-hero h1 { font-size: 2rem; }
  .screener-grid { grid-template-columns: 1fr; }
}

/* === Button Variants === */
.btn-secondary {
  background: #e5e7eb;
  color: #374151;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  display: inline-block;
  text-align: center;
  transition: all 0.2s ease;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover {
  background: #d1d5db;
  color: #1f2937;
}

/* === Responsive Grid Utilities (Safe Attribute Selector Version) === */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  [class~="md:grid-cols-2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  [class~="md:grid-cols-3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  [class~="md:grid-cols-4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* === Responsive Grid Utilities (Tailwind-like) === */

/* Base grid column utilities */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Medium breakpoint (≥768px) */
@media (min-width: 768px) {
  .md\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Large breakpoint (≥1024px) */
@media (min-width: 1024px) {
  .lg\:grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.table-container {
  overflow-x:auto;
  margin-bottom:1rem;
  border-radius:8px;
  box-shadow:0 2px 6px rgba(0,0,0,0.1);
}

table {
  border-collapse:collapse;
  width:100%;
  min-width:1000px; /* ensures horizontal scroll on small screens */
  background:#fff;
}

th, td {
  padding:10px 14px;
  border:1px solid #ddd;
  text-align:center;
  font-size:14px;
}

th {
  background:#007bff;
  color:#fff;
  font-weight:600;
  cursor:pointer;
  position: sticky;
  top:0;
  z-index:2;
}

tr:nth-child(even){background:#f8f9fa;}
tr:hover {background:#e9f5ff;}

.pos {color:green;font-weight:600;}
.neg {color:red;font-weight:600;}

