/* =========================================
   TOOLVERSE - GLOBAL DARK MODE
   Applies to homepage, tools, articles
   and AdSense pages.
========================================= */

html[data-theme="dark"] {
    color-scheme: dark;
    background: #0f172a;
}

html[data-theme="dark"] body {
    background: #0f172a !important;
    color: #e5e7eb !important;
}

/* =========================================
   GLOBAL TEXT
========================================= */

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] p,
html[data-theme="dark"] label,
html[data-theme="dark"] li,
html[data-theme="dark"] small,
html[data-theme="dark"] strong,
html[data-theme="dark"] span,
html[data-theme="dark"] legend {
    color: #e5e7eb;
}

/* Secondary text */

html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .description,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .info,
html[data-theme="dark"] .info-text,
html[data-theme="dark"] .field-note,
html[data-theme="dark"] .result-note,
html[data-theme="dark"] .result-info,
html[data-theme="dark"] .article-info,
html[data-theme="dark"] .updated,
html[data-theme="dark"] .summary,
html[data-theme="dark"] .helper,
html[data-theme="dark"] .status,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .empty-history,
html[data-theme="dark"] .language-label,
html[data-theme="dark"] .challenge-count,
html[data-theme="dark"] .option-count,
html[data-theme="dark"] .footer p,
html[data-theme="dark"] .footer,
html[data-theme="dark"] footer {
    color: #aebed2 !important;
}

/* =========================================
   COMMON CARDS AND MAIN CONTAINERS
========================================= */

html[data-theme="dark"] .container,
html[data-theme="dark"] .page,
html[data-theme="dark"] .card,
html[data-theme="dark"] .article-container,
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .content-section,
html[data-theme="dark"] .about-box,
html[data-theme="dark"] .email-section,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .history-box,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .history-list li,
html[data-theme="dark"] .name-item,
html[data-theme="dark"] .result-item,
html[data-theme="dark"] .nickname-item,
html[data-theme="dark"] .options-list li,
html[data-theme="dark"] .number-display,
html[data-theme="dark"] .decision-result,
html[data-theme="dark"] .result,
html[data-theme="dark"] .result-section,
html[data-theme="dark"] .result-info,
html[data-theme="dark"] .no-results,
html[data-theme="dark"] .footer,
html[data-theme="dark"] footer {
    background: #172338 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* =========================================
   HOMEPAGE
========================================= */

/* Header */

html[data-theme="dark"] .header,
html[data-theme="dark"] header {
    background: #111c30 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .logo,
html[data-theme="dark"] .footer-logo {
    color: #93c5fd !important;
}

html[data-theme="dark"] .nav a {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .nav a:hover {
    color: #93c5fd !important;
}

/* Hero */

html[data-theme="dark"] .hero {
    background: #16263e !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .hero h1 {
    color: #bfdbfe !important;
}

html[data-theme="dark"] .hero p {
    color: #cbd5e1 !important;
}

/* Search */

html[data-theme="dark"] .search-box {
    background: #172338 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .search-box input {
    background: transparent !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .search-box input::placeholder {
    color: #94a3b8 !important;
}

/* Tool cards */

html[data-theme="dark"] .tool-card {
    background: #172338 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .tool-info h3 {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .tool-info p {
    color: #aebed2 !important;
}

html[data-theme="dark"] .tool-icon {
    background: #263a55 !important;
    color: #bfdbfe !important;
}

/* Welcome section */

html[data-theme="dark"] .about-section,
html[data-theme="dark"] .about-box {
    background: #172338 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .about-box h2 {
    color: #bfdbfe !important;
}

html[data-theme="dark"] .about-box p {
    color: #cbd5e1 !important;
}

/* Helpful articles */

html[data-theme="dark"] .articles-section {
    background: transparent !important;
}

html[data-theme="dark"] .articles-section h2,
html[data-theme="dark"] .section-heading h2 {
    color: #bfdbfe !important;
}

html[data-theme="dark"] .section-heading p {
    color: #aebed2 !important;
}

html[data-theme="dark"] .article-links a {
    background: #172338 !important;
    color: #bfdbfe !important;
    border: 1px solid #334155 !important;
}

html[data-theme="dark"] .article-links a:hover {
    background: #263a55 !important;
    color: #ffffff !important;
}

/* =========================================
   ARTICLE PAGES
========================================= */

html[data-theme="dark"] .article-container {
    background: #172338 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .article-container h1 {
    color: #bfdbfe !important;
}

html[data-theme="dark"] .article-container h2,
html[data-theme="dark"] .article-container h3 {
    color: #93c5fd !important;
}

html[data-theme="dark"] .article-container p,
html[data-theme="dark"] .article-container li {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .intro,
html[data-theme="dark"] .tip,
html[data-theme="dark"] .conclusion {
    background: #223650 !important;
    color: #e5e7eb !important;
    border-color: #3b506b !important;
}

html[data-theme="dark"] .intro p,
html[data-theme="dark"] .tip p,
html[data-theme="dark"] .conclusion p {
    color: #dbeafe !important;
}

html[data-theme="dark"] .article-navigation a,
html[data-theme="dark"] .nav-link {
    background: #2563a8 !important;
    color: #ffffff !important;
    border-color: #3b82c4 !important;
}

/* =========================================
   ADSENSE / POLICY PAGES
========================================= */

html[data-theme="dark"] .highlight,
html[data-theme="dark"] .contact-note {
    background: #223650 !important;
    color: #dbeafe !important;
    border-color: #3b506b !important;
}

html[data-theme="dark"] .highlight p,
html[data-theme="dark"] .contact-note p {
    color: #dbeafe !important;
}

html[data-theme="dark"] .email-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .email-link,
html[data-theme="dark"] .contact-link {
    color: #93c5fd !important;
}

/* =========================================
   PICTURE TO EMOJI
========================================= */

html[data-theme="dark"] .upload-box {
    background: #223650 !important;
    color: #e5e7eb !important;
    border-color: #60a5fa !important;
}

html[data-theme="dark"] .upload-box p,
html[data-theme="dark"] .upload-box label {
    color: #dbeafe !important;
}

html[data-theme="dark"] .preview-img {
    background: #0f172a !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] .progress-track {
    background: #334155 !important;
}

html[data-theme="dark"] .note {
    background: #223650 !important;
    color: #cbd5e1 !important;
    border-color: #3b506b !important;
}

/* =========================================
   GENERATORS AND CALCULATORS
========================================= */

html[data-theme="dark"] .formula,
html[data-theme="dark"] .result-info,
html[data-theme="dark"] .result-note,
html[data-theme="dark"] .result-description,
html[data-theme="dark"] .birthday-box,
html[data-theme="dark"] .age-main,
html[data-theme="dark"] .age-part,
html[data-theme="dark"] .decision-area,
html[data-theme="dark"] .quick-options button,
html[data-theme="dark"] .nickname-item,
html[data-theme="dark"] .name-item,
html[data-theme="dark"] .result-item,
html[data-theme="dark"] .preview,
html[data-theme="dark"] .qr-stage {
    background: #223650 !important;
    color: #e5e7eb !important;
    border-color: #3b506b !important;
}

html[data-theme="dark"] .formula *,
html[data-theme="dark"] .result-info *,
html[data-theme="dark"] .result-note *,
html[data-theme="dark"] .birthday-box *,
html[data-theme="dark"] .age-main *,
html[data-theme="dark"] .age-part * {
    color: #dbeafe !important;
}

html[data-theme="dark"] .name-style,
html[data-theme="dark"] .result-style,
html[data-theme="dark"] .nickname-text,
html[data-theme="dark"] .result-description,
html[data-theme="dark"] .content-text,
html[data-theme="dark"] .question-display,
html[data-theme="dark"] .english-text,
html[data-theme="dark"] .info-text {
    color: #cbd5e1 !important;
}

/* =========================================
   LOVE AND FRIENDSHIP CALCULATORS
========================================= */

html[data-theme="dark"] .heart,
html[data-theme="dark"] .friend-icon {
    background: #263a55 !important;
    color: #f9a8d4 !important;
}

html[data-theme="dark"] .meter::before {
    background: #172338 !important;
}

html[data-theme="dark"] .meter-content {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .couple-names,
html[data-theme="dark"] .names,
html[data-theme="dark"] .result-message,
html[data-theme="dark"] .result-title,
html[data-theme="dark"] .result-emoji {
    color: #fbcfe8 !important;
}

html[data-theme="dark"] .disclaimer {
    background: #223650 !important;
    color: #cbd5e1 !important;
    border-color: #3b506b !important;
}

/* =========================================
   TRUTH OR DARE
========================================= */

html[data-theme="dark"] .stat,
html[data-theme="dark"] .challenge,
html[data-theme="dark"] .mode-info {
    background: #223650 !important;
    color: #e5e7eb !important;
    border-color: #3b506b !important;
}

html[data-theme="dark"] .challenge p,
html[data-theme="dark"] .hindi-text,
html[data-theme="dark"] .english-text {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .challenge.dare-theme {
    background: #3b263c !important;
}

html[data-theme="dark"] .challenge-label {
    color: #93c5fd !important;
}

/* =========================================
   INPUTS AND FORM CONTROLS
========================================= */

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    border-color: #60a5fa !important;
    outline-color: #60a5fa !important;
}

html[data-theme="dark"] option {
    background: #172338 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"],
html[data-theme="dark"] input[type="range"] {
    accent-color: #3b82f6;
}

/* =========================================
   LINKS
========================================= */

html[data-theme="dark"] a {
    color: #93c5fd;
}

html[data-theme="dark"] a:hover {
    color: #bfdbfe;
}

html[data-theme="dark"] .back,
html[data-theme="dark"] .back-link {
    color: #93c5fd !important;
}

/* =========================================
   BUTTONS
   Preserve primary button colours.
========================================= */

html[data-theme="dark"] .clear-btn,
html[data-theme="dark"] .clear-button,
html[data-theme="dark"] .clear-history,
html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .action-button.secondary,
html[data-theme="dark"] .action-btn.secondary,
html[data-theme="dark"] .copy-btn,
html[data-theme="dark"] .light-btn,
html[data-theme="dark"] .swap-button,
html[data-theme="dark"] .try-button {
    background: #263a55 !important;
    color: #bfdbfe !important;
    border-color: #405675 !important;
}

html[data-theme="dark"] .filter,
html[data-theme="dark"] .category-btn {
    background: #263a55 !important;
    color: #cbd5e1 !important;
    border-color: #405675 !important;
}

html[data-theme="dark"] .filter.active,
html[data-theme="dark"] .category-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
}

/* Keep primary buttons readable */

html[data-theme="dark"] .primary,
html[data-theme="dark"] .primary-btn,
html[data-theme="dark"] .primary-button,
html[data-theme="dark"] .generate-button,
html[data-theme="dark"] .main-button,
html[data-theme="dark"] .pink-button,
html[data-theme="dark"] .pink-btn,
html[data-theme="dark"] .action-button:not(.secondary),
html[data-theme="dark"] .action-btn:not(.secondary),
html[data-theme="dark"] .truth-btn,
html[data-theme="dark"] .dare-btn,
html[data-theme="dark"] .search-box button {
    color: #ffffff !important;
}

/* =========================================
   TABLES AND SEPARATORS
========================================= */

html[data-theme="dark"] table {
    background: #172338 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] th {
    background: #263a55 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] td,
html[data-theme="dark"] th {
    border-color: #334155 !important;
}

html[data-theme="dark"] hr,
html[data-theme="dark"] .section-divider {
    border-color: #334155 !important;
}

/* =========================================
   FOOTERS
========================================= */

html[data-theme="dark"] footer,
html[data-theme="dark"] .footer {
    background: #111c30 !important;
    color: #aebed2 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] footer a,
html[data-theme="dark"] .footer-links a {
    color: #93c5fd !important;
}

html[data-theme="dark"] footer a:hover,
html[data-theme="dark"] .footer-links a:hover {
    color: #bfdbfe !important;
}

/* =========================================
   HOMEPAGE THEME BUTTON
========================================= */

.theme-toggle {
    min-width: 76px;
    padding: 9px 15px;
    border: 1px solid #1769d2;
    border-radius: 8px;
    background: #1769d2;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.theme-toggle:hover {
    background: #1058b5;
}

.theme-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.3);
    outline-offset: 2px;
}

html[data-theme="dark"] .theme-toggle {
    background: #263a55 !important;
    color: #ffffff !important;
    border-color: #52749c !important;
}

/* =========================================
   ACCESSIBILITY
========================================= */

html[data-theme="dark"] ::selection {
    background: #2563eb;
    color: #ffffff;
}

html[data-theme="dark"] :focus-visible {
    outline-color: #60a5fa;
}