/* ==========================================================================
   OPTIONALYTICS - PREMIUM FINTECH DESIGN SYSTEM & STYLESHEET
   Domain: https://optionalytics.in/
   Educational & Analytical Platform for NSE Options, OI, PCR, LTP & Strategy
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Color Palette - Dark Modern Fintech */
  --bg-dark: #07090e;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-surface: #111827;
  --bg-input: #1e293b;

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --accent-glow: rgba(0, 242, 254, 0.25);

  --call-green: #10b981;
  --call-bg: rgba(16, 185, 129, 0.12);
  --call-border: rgba(16, 185, 129, 0.3);

  --put-red: #ef4444;
  --put-bg: rgba(239, 68, 68, 0.12);
  --put-border: rgba(239, 68, 68, 0.3);

  --atm-gold: #f59e0b;
  --atm-bg: rgba(245, 158, 11, 0.15);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 242, 254, 0.5);

  /* Layout & Geometry */
  --max-width: 1280px;
  --header-height: 76px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;

  /* Transitions & Shadows */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.2);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition);
}

a:hover, a:focus-visible {
  color: #38ef7d;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* --- Container Utility --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header & Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo img {
  height: 44px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #040914;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.4);
  color: #000000;
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  color: var(--accent-cyan);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Mobile Toggle Hamburger */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* --- Hero Section --- */
.hero-section {
  padding: 5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(0, 242, 254, 0.08) 0%, rgba(7, 9, 14, 0) 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #CBD5E1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subheading {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-disclaimer-box {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
}

/* Financial Dashboard Glass Card Preview */
.dash-preview-card {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.dash-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.dash-preview-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: var(--call-green);
  border: 1px solid var(--call-border);
}

.badge-info {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.stat-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
}

.stat-pill .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.stat-pill .value {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.value.green { color: var(--call-green); }
.value.red { color: var(--put-red); }
.value.cyan { color: var(--accent-cyan); }

/* --- Section Layouts --- */
.section {
  padding: 4.5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

/* --- AdSense Containers (Google Compliant) --- */
.ad-container {
  width: 100%;
  margin: 2.5rem 0;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.ad-slot-placeholder {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: monospace;
}

/* --- Option Chain Data Table Component --- */
.option-chain-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.table-toolbar {
  padding: 1.25rem 1.5rem;
  background: rgba(17, 24, 39, 0.8);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.form-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.9rem;
}

.form-control:focus {
  border-color: var(--accent-cyan);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.option-chain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
  white-space: nowrap;
}

.option-chain-table th {
  background: #0d1322;
  color: var(--text-muted);
  padding: 0.75rem 0.6rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.option-chain-table th.center, .option-chain-table td.center {
  text-align: center;
}

.option-chain-table th.call-header {
  background: rgba(16, 185, 129, 0.15);
  color: var(--call-green);
  text-align: center;
}

.option-chain-table th.put-header {
  background: rgba(239, 68, 68, 0.15);
  color: var(--put-red);
  text-align: center;
}

.option-chain-table td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.option-chain-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.option-chain-table tr.atm-row {
  background: var(--atm-bg) !important;
  border-top: 1px solid var(--atm-gold);
  border-bottom: 1px solid var(--atm-gold);
}

.option-chain-table tr.atm-row td.strike-cell {
  background: var(--atm-gold);
  color: #000000;
  font-weight: 800;
}

.strike-cell {
  font-weight: 700;
  background: #131c2e;
  color: #ffffff;
}

.call-itm { background: rgba(16, 185, 129, 0.05); }
.put-itm { background: rgba(239, 68, 68, 0.05); }

/* --- Interactive Tool Cards & Calculators --- */
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.calc-output {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 1.5rem;
}

.calc-result-box {
  text-align: center;
}

.calc-result-box .result-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.calc-result-box .result-val {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

/* --- Educational Content Layouts --- */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
}

.article-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

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

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-main);
}

.article-body p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.article-body ul, .article-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-muted);
}

.article-body li {
  margin-bottom: 0.5rem;
}

.info-callout {
  background: rgba(0, 242, 254, 0.08);
  border-left: 4px solid var(--accent-cyan);
  padding: 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
}

.info-callout p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.widget-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.widget-links li {
  margin-bottom: 0.75rem;
}

.widget-links a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}

.widget-links a:hover {
  color: var(--accent-cyan);
}

/* --- Disclaimer Box --- */
.disclaimer-banner {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 3rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.disclaimer-banner strong {
  color: var(--text-main);
}

/* --- Footer --- */
.site-footer {
  background: #04060a;
  border-top: 1px solid var(--border-light);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

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

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 320px;
}

.footer-column h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --- Responsive Rules --- */
@media (max-width: 1024px) {
  .hero-grid, .content-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: #0b0f19;
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: 999;
  }

  .nav-links.show {
    transform: translateY(0);
  }

  .header-cta {
    display: none;
  }

  .hero-content h1 {
    font-size: 2.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .stat-pills {
    grid-template-columns: 1fr;
  }
}
