/* 
    YourCalc Global Design System
    Centralized styles for all calculator pages.
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;600&display=swap');

:root {
    --bg: #0d0f14;
    --surface: #161921;
    --border: #252836;
    --accent: #f5a623;
    --accent2: #3ecf8e;
    --text: #e8eaf0;
    --muted: #6b7280;
    --error: #ef4444;
    --header-height: 120px;
    --sidebar-width: 0px;
}

[data-theme="light"] {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --border: #e9ecef;
    --text: #212529;
    --muted: #6c757d;
    --accent2: #2f855a;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-font-smoothing: antialiased; 
}

/* Layout */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

main {
    flex: 1;
    margin-left: 0;
    padding: 160px 40px 40px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.container {
    max-width: 1024px;
    width: 100%;
}

/* Common Typography */
h1 { 
    font-size: 40px; 
    font-weight: 600; 
    margin-bottom: 8px; 
    letter-spacing: -0.02em; 
}

.subtitle { 
    color: var(--muted); 
    margin-bottom: 32px; 
    font-size: 16px; 
    line-height: 1.6; 
}

/* Typography for Info Pages (About, Privacy, etc.) */
.page-h1 { font-size: 42px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 16px; }
.page-h2 { font-size: 24px; font-weight: 600; color: var(--accent); margin: 40px 0 20px; letter-spacing: -0.01em; }
.page-h3 { font-size: 18px; font-weight: 600; margin: 24px 0 12px; }
.page-p { font-size: 16px; line-height: 1.8; color: var(--text); margin-bottom: 20px; opacity: 0.9; }

/* Components */
.highlight-box {
    background: rgba(245, 166, 35, 0.07);
    border: 1px solid rgba(245, 166, 35, 0.2);
    border-radius: 16px;
    padding: 24px 28px;
    margin: 32px 0;
}
.highlight-box p { margin-bottom: 0; }

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

/* Footer */
.site-footer {
    margin-top: 80px;
    padding: 60px 0 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    width: 100%;
}

.footer-links {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, opacity 0.2s;
}

.footer-links a:hover {
    color: var(--text);
    opacity: 1;
}

.footer-copy {
    opacity: 0.6;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .footer-links { gap: 16px; }
    .site-footer { padding: 40px 16px; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    margin-top: 40px;
}

/* Tabs */
.tabs { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 32px; 
    overflow-x: auto; 
    padding-bottom: 8px; 
    border-bottom: 1px solid var(--border); 
}

.tab-btn { 
    background: none; 
    border: none; 
    color: var(--muted); 
    padding: 10px 16px; 
    font-family: 'Outfit'; 
    font-size: 14px; 
    cursor: pointer; 
    white-space: nowrap; 
    transition: all 0.2s; 
    border-radius: 8px; 
}

.tab-btn:hover { 
    color: var(--text); 
    background: var(--surface); 
}

.tab-btn.active { 
    color: var(--accent); 
    background: rgba(245, 166, 35, 0.1); 
}

/* Calculator Containers */
.calc-container { 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: 24px; 
    padding: 40px; 
    display: none; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
}

.calc-container.active { 
    display: block; 
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
}

/* Form Elements */
.input-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 24px; 
    margin-bottom: 32px; 
}

.input-group { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.input-group label { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 12px; 
    font-weight: 600; 
    color: var(--muted); 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}

.input-wrapper { 
    position: relative; 
    display: flex; 
    align-items: center; 
}

.input-wrapper input, 
.input-wrapper select, 
.input-wrapper textarea { 
    width: 100%; 
    height: 56px; 
    background: var(--bg); 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 0 20px; 
    color: var(--text); 
    font-family: 'DM Mono', monospace; 
    font-size: 16px; 
    transition: all 0.2s; 
}

.input-wrapper textarea {
    height: 120px;
    padding: 20px;
    font-family: 'Outfit', sans-serif;
    resize: none;
}

.input-wrapper input:focus, 
.input-wrapper select:focus, 
.input-wrapper textarea:focus { 
    outline: none; 
    border-color: var(--accent); 
    box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.1); 
}

.btn-calculate { 
    width: 100%; 
    height: 60px; 
    background: var(--accent); 
    color: #000; 
    border: none; 
    border-radius: 12px; 
    font-family: 'Outfit'; 
    font-weight: 700; 
    font-size: 18px; 
    cursor: pointer; 
    transition: all 0.2s; 
    margin-top: 12px; 
}

.btn-calculate:hover { 
    background: #ffb84d; 
    transform: translateY(-2px); 
    box-shadow: 0 10px 20px rgba(245, 166, 35, 0.2); 
}

/* Results */
.result-panel { 
    margin-top: 40px; 
    padding-top: 40px; 
    border-top: 1px solid var(--border); 
    display: none; 
}

.result-panel.visible { 
    display: block; 
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
}

.result-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 24px; 
}

.result-item { 
    padding: 20px; 
    background: rgba(255,255,255,0.02); 
    border-radius: 16px; 
    border: 1px solid var(--border); 
}

.result-label { 
    font-size: 11px; 
    color: var(--muted); 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    margin-bottom: 8px; 
    display: block; 
}

.result-value { 
    font-family: 'DM Mono', monospace; 
    font-size: 28px; 
    font-weight: 600; 
    color: var(--accent2); 
}

/* Sections */
.seo-section { 
    margin-top: 64px; 
    width: 100%;
}

.seo-section h2 { 
    font-size: 28px; 
    font-weight: 600; 
    margin-bottom: 24px; 
    letter-spacing: -0.01em; 
}

.info-block { 
    display: none; 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: 24px; 
    padding: 40px; 
    margin-top: 32px; 
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
}

.info-block.active { 
    display: block; 
}

.info-block h2 { 
    font-size: 24px; 
    margin-bottom: 16px; 
}

.info-block h3 { 
    font-size: 18px; 
    margin-bottom: 12px; 
}

.info-block p, .info-block li {
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 16px;
}

.info-block p:last-child {
    margin-bottom: 0;
}

/* Feedback & Comments */
.feedback-section { 
    margin-top: 64px; 
}

.feedback-section > div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
}

.feedback-section h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.feedback-section p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.comment-thread {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

/* Ads & Compliance */
.ad-top {
    width: 100%;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-bottom {
    width: 100%;
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Desktop Gutter Ads (AdSense vertical units) */
.ad-gutter {
    position: fixed;
    top: 160px;
    width: 160px;
    height: 600px;
    display: none; /* Hidden by default, shown on desktop */
    z-index: 10;
}

.ad-gutter-left {
    left: 40px;
}

.ad-gutter-right {
    right: 40px;
}

@media (min-width: 1400px) {
    .ad-gutter {
        display: block;
    }
}

@media (max-width: 1399px) {
    .ad-gutter {
        display: none !important;
    }
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    main { padding: 100px 16px 40px !important; }
    .ad-top { margin-bottom: 24px; }
}

@media (max-width: 768px) {
    h1 { font-size: 32px; }
    .input-grid, .result-grid { grid-template-columns: 1fr; }
    .calc-container { padding: 24px; }
    .info-block { padding: 24px; }
    .feedback-section > div { padding: 24px; }
}

@keyframes fadeIn { 
    from { opacity: 0; transform: scale(0.98); } 
    to { opacity: 1; transform: scale(1); } 
}

@keyframes slideUp { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Ads */
.ad-unit {
    width: 100%;
    margin: 16px 0;
    min-height: 90px;
    background: rgba(255,255,255,0.05);
    text-align: center;
    border-radius: 8px;
}

.ad-top { border-bottom: 1px solid var(--border); }
.ad-below-results { border-top: 1px solid var(--border); margin-top: 12px; }

.ad-label {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

/* SEO Content */
.seo-content {
    background: var(--surface);
    border-left: 4px solid var(--accent);
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

/* Static Page Typography */
.page-h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; color: var(--text); }
.page-h2 { font-size: 24px; font-weight: 600; color: var(--accent); margin: 48px 0 16px; }
.page-h3 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; color: var(--text); }
.page-p { font-size: 16px; line-height: 1.8; color: var(--muted); margin-bottom: 16px; }
.page-list { padding-left: 24px; margin-bottom: 24px; color: var(--muted); }
.page-list li { margin-bottom: 10px; font-size: 15px; line-height: 1.7; }
.effective-date { color: var(--muted); font-size: 14px; margin-bottom: 48px; }
.effective-date span { color: var(--accent); font-weight: 600; }

.highlight-box {
    background: rgba(245, 166, 35, 0.05);
    border: 1px solid rgba(245, 166, 35, 0.15);
    border-radius: 20px;
    padding: 32px;
    margin: 40px 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
}

/* Site Footer */
.site-footer {
    margin-top: auto;
    padding: 60px 0;
    width: 100%;
    border-top: 1px solid var(--border);
    background: var(--surface);
    text-align: center;
    z-index: 10;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

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

.footer-copy {
    color: var(--muted);
    font-size: 13px;
    opacity: 0.8;
}


/* Email Capture Widget */
.yc-capture-widget {
  margin-top: 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px 24px;
  position: relative;
  animation: slideUp 0.3s ease;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  z-index: 100;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.yc-capture-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}

.yc-capture-headline {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 4px;
}

.yc-capture-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.yc-capture-form {
  display: flex;
  gap: 8px;
}

.yc-capture-form input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.yc-capture-form button {
  padding: 8px 16px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.yc-capture-legal {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 10px;
}

.yc-capture-legal a {
  color: var(--muted);
  text-decoration: underline;
}
