/* Styles added after the move from Laravel. app.css is the unchanged Laravel build. */

/* Social link circles in the header (.bg-facebook / .bg-youtube are in app.css) */
.bg-tiktok { background-color: #000; }
.bg-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.bg-shopee { background-color: #ee4d2d; }

/* Centre each icon in its circle */
.social-media ul li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Theme toggle (components/ThemeToggle.tsx)
   ========================================================================== */

.theme-toggle {
  background: none;
  border: 0;
  padding: 0;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:focus-visible { color: red; }
/* Hover only on real pointers: touch screens keep :hover after a tap */
@media (hover: hover) {
  .theme-toggle:hover { color: red; }
}
/* No lingering focus ring after a tap or click; keyboard focus still shows it */
.theme-toggle:focus:not(:focus-visible) { outline: none; }
.theme-toggle-icon { font-size: 1rem; line-height: 1; padding: 0.25rem; }

/* The mobile menu item looks like the other links in that menu */
.mobile-navigation .theme-toggle-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 0.5rem 0; /* same spacing as the menu links above it */
  text-align: left;
}

/* Show only the option the reader can switch to */
.theme-toggle-to-dark { display: none; }
html[data-theme="light"] .theme-toggle-to-light { display: none; }
html[data-theme="light"] .theme-toggle-to-dark { display: inline; }

/* ==========================================================================
   Dark mode (the default). Light mode is the original Laravel look, so it
   needs no rules: everything below applies only to html[data-theme="dark"].

   Layers, darkest to lightest:
     #000     "black" bands (.bg-black: menu bar, page headings, video strip)
     #121212  page background (.bg-light)
     #1c1c1c  cards and panels (.bg-white)
     #262626  raised details (spec labels, active banner tab, hovers)
   ========================================================================== */

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

  --rr-band: #000;
  --rr-page: #121212;
  --rr-surface: #1c1c1c;
  --rr-raised: #262626;
  --rr-border: #333;
  --rr-text: #e0e0e0;
  --rr-text-strong: #f5f5f5;
  --rr-text-body: #cfcfcf;
  --rr-text-muted: #a0a0a0;
  --rr-link: #6ea8fe;
  --rr-link-hover: #9ec5fe;
}
html[data-theme="light"] { color-scheme: light; }

html[data-theme="dark"] body { color: var(--rr-text); }

/* --- Backgrounds (Bootstrap's are !important, so these must be too) --- */
html[data-theme="dark"] .bg-light { background-color: var(--rr-page) !important; }
html[data-theme="dark"] .bg-white { background-color: var(--rr-surface) !important; }
html[data-theme="dark"] .bg-black { background-color: var(--rr-band); }
html[data-theme="dark"] .bg-dark { background-color: var(--rr-raised) !important; }
@media (max-width: 991.98px) {
  html[data-theme="dark"] .bg-md-black { background-color: var(--rr-band); }
}
@media (max-width: 575.98px) {
  html[data-theme="dark"] .bg-xs-black { background-color: var(--rr-band); }
}

/* --- Text --- */
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .text-muted { color: var(--rr-text-muted) !important; }
html[data-theme="dark"] .text-dark { color: var(--rr-text) !important; }

html[data-theme="dark"] .section-title p,
html[data-theme="dark"] .news-item .info h3 { color: var(--rr-text-strong); }
html[data-theme="dark"] .mobile-menu,
html[data-theme="dark"] .mobile-menu i { color: var(--rr-text-strong); }

/* --- Borders and rules --- */
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom { border-color: var(--rr-border) !important; }
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .banner .nav-link { border-color: var(--rr-border); }
html[data-theme="dark"] .news-list ul li { border-bottom-color: var(--rr-border); }
html[data-theme="dark"] .news-list ul li:last-child { border: 0; }
html[data-theme="dark"] .border-md-right { border-right-color: var(--rr-border); }
html[data-theme="dark"] hr { border-top-color: rgba(255, 255, 255, 0.12); }

/* --- Header and footer --- */
html[data-theme="dark"] footer ul li a { color: var(--rr-text-muted); }
html[data-theme="dark"] footer ul li a:hover { color: var(--rr-text-strong); }

/* --- Home banner: the selected "Terkini" tab and its arrow --- */
html[data-theme="dark"] .banner .nav-pills .nav-link.active,
html[data-theme="dark"] .banner .nav-pills .show > .nav-link {
  color: var(--rr-text-strong);
  background-color: var(--rr-raised);
}
html[data-theme="dark"] .banner .nav-pills .nav-link.active::after,
html[data-theme="dark"] .banner .nav-pills .show > .nav-link::after { border-right-color: var(--rr-raised); }
html[data-theme="dark"] .banner .nav-link { color: var(--rr-text); }

/* --- Article body and pages (EE content) --- */
html[data-theme="dark"] .article .content p { color: var(--rr-text-body); }
html[data-theme="dark"] .article .content,
html[data-theme="dark"] .article .content li { color: var(--rr-text-body); }
/* Links inside EE content use Bootstrap's default blue, too dark on black.
   (Only here: every other link on the site sets its own colour.) */
html[data-theme="dark"] .article .content a { color: var(--rr-link); }
html[data-theme="dark"] .article .content a:hover { color: var(--rr-link-hover); }
/* Text pasted into EE (often from Word) can carry inline black colours that
   would be unreadable on a dark background, so inline text colours are dropped
   in dark mode. Background colours and light mode are left alone. */
html[data-theme="dark"] .article .content [style*="color"]:not([style*="background"]),
html[data-theme="dark"] .article .content font[color] { color: inherit !important; }

/* --- Pandu Uji specification table --- */
html[data-theme="dark"] .specifications table tr:not(:last-child) { border-bottom-color: var(--rr-border); }
html[data-theme="dark"] .specifications .specification-title { background-color: var(--rr-raised); }

/* --- Forms --- */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select {
  color: var(--rr-text);
  background-color: var(--rr-raised);
  border-color: #444;
}
html[data-theme="dark"] .form-control:focus {
  color: var(--rr-text-strong);
  background-color: var(--rr-raised);
}
html[data-theme="dark"] .form-control::placeholder { color: #8a8a8a; }

/* --- Pagination --- */
html[data-theme="dark"] .page-link,
html[data-theme="dark"] .page-item.disabled .page-link {
  background-color: var(--rr-surface);
  border-color: var(--rr-border);
}
html[data-theme="dark"] .page-link:hover { background-color: var(--rr-raised); border-color: var(--rr-border); }
html[data-theme="dark"] .pagination-container nav .pagination .page-item.disabled .page-link { color: #6c6c6c; }

/* --- Newsletter messages (components/NewsletterStatus.tsx) --- */
html[data-theme="dark"] .alert-success { color: #75b798; background-color: #051b11; border-color: #0f5132; }
html[data-theme="dark"] .alert-danger { color: #ea868f; background-color: #2c0b0e; border-color: #842029; }
html[data-theme="dark"] .alert-warning { color: #ffda6a; background-color: #332701; border-color: #997404; }
html[data-theme="dark"] .alert-info { color: #6edff6; background-color: #032830; border-color: #087990; }
