/* Dark Mode Overrides */
/* Smooth transition for theme switching */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   Toggle Button
   ============================================ */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background-color: #2c3e50;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

[data-theme="dark"] .theme-toggle {
  background-color: #ffd700;
  color: #1a1a2e;
}

/* ============================================
   Global / layout.css overrides
   ============================================ */
[data-theme="dark"] body {
  background: #1a1a2e;
  color: #e0e0e0;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #e0e0e0;
}

[data-theme="dark"] a {
  color: #64b5f6;
}

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

[data-theme="dark"] .bg-steel {
  background-color: #0f3460;
}

[data-theme="dark"] .site-header .navbar-nav .nav-link {
  color: #ccc;
}

[data-theme="dark"] .site-header .navbar-nav .nav-link:hover {
  color: #fff;
}

[data-theme="dark"] .content-section {
  background: #16213e;
  border-color: #2a2a4a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .article-title {
  color: #e0e0e0;
}

[data-theme="dark"] a.article-title:hover {
  color: #64b5f6;
}

[data-theme="dark"] .article-metadata {
  border-bottom-color: #2a2a4a;
}

[data-theme="dark"] .post-timetstamp {
  color: #a0a0a0;
}

[data-theme="dark"] .wiki-page-title {
  color: #e0e0e0;
}

[data-theme="dark"] .wiki-page-summary {
  background-color: #1a1a2e;
  color: #ccc;
}

[data-theme="dark"] .wiki-page-date {
  color: #a0a0a0;
}

[data-theme="dark"] .search-bar input {
  background-color: #1a1a2e;
  border-color: #2a2a4a;
  color: #e0e0e0;
}

[data-theme="dark"] .email {
  color: #ccc;
}

[data-theme="dark"] .ad-container {
  background-color: #16213e;
}

[data-theme="dark"] post {
  border-color: #2a2a4a;
  background-color: #16213e;
}

/* ============================================
   home.css overrides
   ============================================ */
html[data-theme="dark"] {
  --background-color: #1a1a2e;
  --primary-color: #e0e0e0;
  --secondary-color: #a0a0a0;
  --card-bg: #16213e;
  --border-color: #2a2a4a;
}

/* body::before background pattern: mute in dark mode */
[data-theme="dark"] body::before {
  opacity: 0.2;
}

[data-theme="dark"] .search-section {
  background-color: rgba(22, 33, 62, 0.8);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #query {
  color: #64b5f6;
}

[data-theme="dark"] .search_bar {
  background-color: #1a1a2e;
  border-color: #2a2a4a;
  color: #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .option_button {
  background-color: #16213e;
  color: #e0e0e0;
  border-color: rgba(100, 181, 246, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .option_button:hover {
  background-color: #1a2a4e;
  border-color: rgba(100, 181, 246, 0.3);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .update-badge {
  box-shadow: 0 0 0 2px #16213e, 0 2px 4px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .articles {
  background-color: #16213e;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .article-peek {
  background-color: #1a1a2e;
  border-left-color: #64b5f6;
}

[data-theme="dark"] .article-peek a {
  color: #e0e0e0;
}

[data-theme="dark"] .article-peek .title {
  color: #64b5f6;
}

[data-theme="dark"] .today-word {
  background-color: #16213e;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .today-word a {
  background-color: #1a1a2e;
}

[data-theme="dark"] .today-word a:hover {
  background-color: var(--accent-color);
  color: white;
}

[data-theme="dark"] .recent-searches {
  background-color: rgba(22, 33, 62, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .recent-searches-header {
  color: #a0a0a0;
}

[data-theme="dark"] .recent-search-item {
  background-color: #1a1a2e;
  color: #ccc;
}

[data-theme="dark"] .recent-search-item:hover {
  background-color: #2a2a4a;
}

/* ============================================
   result.css overrides
   ============================================ */
[data-theme="dark"] .page_title {
  color: #e0e0e0;
}

[data-theme="dark"] .keyword {
  text-decoration-color: #e0e0e0;
}

[data-theme="dark"] div {
  color: #e0e0e0;
}

[data-theme="dark"] .query {
  color: #e0e0e0;
}

[data-theme="dark"] #definitions,
[data-theme="dark"] #example-section {
  color: #e0e0e0;
}

[data-theme="dark"] .button {
  color: #e0e0e0;
  background-color: #16213e;
  box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .button:hover {
  color: #fff;
}

[data-theme="dark"] .section-title {
  color: #e0e0e0;
  background-color: #1a2a4e;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .section-title.antonym-title {
  background-color: #3e1a1a;
}

[data-theme="dark"] .section-title:hover {
  background-color: #1a3a4e;
}

[data-theme="dark"] .synonym_button,
[data-theme="dark"] .antonym_button {
  background-color: #16213e;
  color: #e0e0e0;
}

[data-theme="dark"] .dialog {
  background-color: #16213e;
  color: #e0e0e0;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] a {
  color: #ff8a65;
}

/* ============================================
   realtime.css overrides
   ============================================ */
[data-theme="dark"] .page-title {
  color: #e0e0e0;
}

[data-theme="dark"] .page-title a {
  color: #ff8a65;
}

[data-theme="dark"] .realtime-list {
  background-color: #16213e;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .realtime-item {
  border-bottom-color: #2a2a4a;
}

[data-theme="dark"] .realtime-item:hover {
  background-color: #1a2a4e;
}

[data-theme="dark"] .realtime-keyword {
  color: #e0e0e0;
}

[data-theme="dark"] .realtime-keyword:hover {
  color: #ff8a65;
}

[data-theme="dark"] .survey-link {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================
   about.css overrides
   ============================================ */
[data-theme="dark"] footer {
  color: #e0e0e0;
}

[data-theme="dark"] .slogan {
  color: #e0e0e0;
}

[data-theme="dark"] .content {
  color: #e0e0e0;
}

/* ============================================
   article.css overrides
   ============================================ */
[data-theme="dark"] .article-page body,
[data-theme="dark"].article-page body {
  color: #ccc;
}

[data-theme="dark"] .back a,
[data-theme="dark"] .back-button a {
  color: #64b5f6;
}

/* ============================================
   ios_app.css overrides
   ============================================ */
[data-theme="dark"] .feature-card {
  background: #16213e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .feature-title {
  color: #e0e0e0;
}

[data-theme="dark"] .feature-desc {
  color: #a0a0a0;
}

[data-theme="dark"] .app-title {
  color: #e0e0e0;
}

[data-theme="dark"] .app-tagline {
  color: #a0a0a0;
}

[data-theme="dark"] .app-footer {
  border-top-color: #2a2a4a;
}

[data-theme="dark"] .footer-text {
  color: #a0a0a0;
}

/* ============================================
   register.css overrides
   ============================================ */
[data-theme="dark"] .login,
[data-theme="dark"] .register {
  background-color: #16213e;
  box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .login h1,
[data-theme="dark"] .register h1 {
  color: #ccc;
  border-bottom-color: #2a2a4a;
}

[data-theme="dark"] .login .links a,
[data-theme="dark"] .register .links a {
  color: #a0a0a0;
}

[data-theme="dark"] .login .links a:hover,
[data-theme="dark"] .register .links a:hover {
  color: #ccc;
}

[data-theme="dark"] .login form input[type="password"],
[data-theme="dark"] .login form input[type="text"],
[data-theme="dark"] .login form input[type="email"],
[data-theme="dark"] .register form input[type="password"],
[data-theme="dark"] .register form input[type="text"],
[data-theme="dark"] .register form input[type="email"] {
  background-color: #1a1a2e;
  border-color: #2a2a4a;
  color: #e0e0e0;
}

/* ============================================
   wiki_mbti.css overrides
   ============================================ */
[data-theme="dark"] .button-container > .mbti-item {
  background: #16213e;
  border-color: #2a2a4a;
}

[data-theme="dark"] .mbti-link {
  color: #e0e0e0;
}

[data-theme="dark"] .mbti_characteristic {
  color: #a0a0a0;
}

[data-theme="dark"] .item > .title {
  color: #e0e0e0;
}

[data-theme="dark"] .return_message > .return_text {
  color: #a0a0a0;
}

[data-theme="dark"] .go_home {
  color: #e0e0e0;
}

/* ============================================
   wall.css overrides
   ============================================ */
[data-theme="dark"] post {
  border-color: #2a2a4a;
  background-color: #16213e;
}
