:root {
  --bg: #f3f4f7;
  --bgd: #050509;
  --txt: #111827;
  --txtd: #e7e7ea;
  --mut: #6b7280;
  --mutd: #a3a7b3;
  --a: #3b82f6;
  --a2: #06b6d4;
  --accent: var(--a);
  --br: rgba(148, 163, 184, .4);
}

/* THEME COLORS */
body.theme-ocean {
  --a: #3b82f6;
  --a2: #06b6d4;
}

body.theme-midnight {
  --a: #0ea5e9;
  --a2: #6366f1;
}

body.theme-sunset {
  --a: #f97316;
  --a2: #ef4444;
}

body.theme-mint {
  --a: #10b981;
  --a2: #34d399;
}

body.theme-neon {
  --a: #a21caf;
  --a2: #ec4899;
}

body.theme-mono {
  --a: #6b7280;
  --a2: #9ca3af;
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  transition: .3s;
}

body.dark {
  background: var(--bgd);
  color: var(--txtd);
}

.cursor-dot,
.cursor-trail {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(59, 130, 246, .9);
}

.cursor-trail {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(59, 130, 246, .45);
  transition: .12s;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100%;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--br);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: .3s;
  z-index: 60;
}

body.dark .sidebar {
  background: rgba(9, 9, 11, .97);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: radial-gradient(circle at 20% 0%, var(--a), var(--a2));
}

.nav-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}

.nav-item:hover {
  background: rgba(148, 163, 184, .15);
}

.nav-item.active {
  background: linear-gradient(120deg, var(--a), var(--a2));
  color: #050816;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--mut);
}

body.dark .sidebar-footer {
  color: var(--mutd);
}

.sidebar-toggle {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 70;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .94);
  color: #fff;
  border: 1px solid var(--br);
  font-size: 13px;
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: .3s;
  z-index: 55;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--br);
  padding: 16px;
  transform: translateX(100%);
  transition: .3s;
  z-index: 65;
}

body.dark .settings-panel {
  background: rgba(15, 23, 42, .98);
}

.settings-panel.open {
  transform: translateX(0);
}

.settings-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 6px;
}

body.dark .settings-label {
  color: var(--mutd);
}

.theme-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

/* Swatch preview colors */
.swatch[data-theme="ocean"] {
  background: linear-gradient(120deg, #3b82f6, #06b6d4);
}

.swatch[data-theme="midnight"] {
  background: linear-gradient(120deg, #0ea5e9, #6366f1);
}

.swatch[data-theme="sunset"] {
  background: linear-gradient(120deg, #f97316, #ef4444);
}

.swatch[data-theme="mint"] {
  background: linear-gradient(120deg, #10b981, #34d399);
}

.swatch[data-theme="neon"] {
  background: linear-gradient(120deg, #a21caf, #ec4899);
}

.swatch[data-theme="mono"] {
  background: linear-gradient(120deg, #6b7280, #9ca3af);
}

.swatch.active {
  border-color: #fff;
}

.page {
  display: none;
  padding: 20px;
}

.page.active {
  display: block;
}

.back-btn {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--br);
}

body.dark .back-btn {
  background: rgba(15, 23, 42, .85);
}

.home-inner {
  max-width: 720px;
  margin: auto;
  text-align: center;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.clock-pill,
.weather-chip {
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(10px);
}
.weather-map {
  height: 400px;
  margin-top: 20px;
}

body.dark .clock-pill,
body.dark .weather-chip {
  background: rgba(15, 23, 42, .92);
}

.logo-main {
  font-size: 54px;
  font-weight: 900;
  letter-spacing: .13em;
  padding: 8px 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 54px rgba(15, 23, 42, .22);
}

.logo-main span {
  background: linear-gradient(120deg, var(--a), var(--a2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-shell {
  width: 100%;
  max-width: 600px;
  
}

.shortener-box {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.shortener-box input {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--br);
  background: transparent;
  color: inherit;
}

.shortener-box button {
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--a), var(--a2));
  border: none;
  color: #050816;
  cursor: pointer;
}

#shortResult {
  margin-top: 15px;
  font-size: 14px;
  color: var(--mut);
}

body.dark #shortResult {
  color: var(--mutd);
}

.chat-box {
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 1rem;
}

body.dark .chat-box {
  background: #111827;
}

.message {
  margin-bottom: 1rem;
  line-height: 1.4;
}

.message.user {
  text-align: right;
  color: var(--a);
}

.message.ai {
  text-align: left;
}

.chat-input-area {
  display: flex;
  gap: .5rem;
}

.chat-input-area input {
  flex: 1;
  padding: .75rem;
  border-radius: 6px;
  border: 1px solid var(--br);
}

.chat-input-area button {
  padding: .75rem 1rem;
  background: var(--a);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.g_id_signin {
  margin-top: 20px;
}

@media (max-width: 600px) {
  .home-inner {
    padding: 20px;
    gap: 16px;
  }

  .shortener-box {
    flex-direction: column;
  }

  .shortener-box input,
  .shortener-box button {
    width: 100%;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#musicToggle {
  display: inline-block;
  position: absolute;
  bottom: 20px;
  right: 20px;
  padding: 10px 15px;
  background: #3b82f6;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  z-index: 1000;
  white-space: nowrap;
}

#musicToggle:hover {
  background: rgb(0, 150, 255);
}

.top-right {
  float: right;
}

#page-weather {
  text-align:center;
}

.weather-form input {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--br);
  background: transparent;
  color: inherit;
}

.weather-form button {
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--a), var(--a2));
  border: none;
  color: #050816;
  cursor: pointer;
}

#stockForm {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  text-align:center;
}

#stockForm input {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--br);
  background: transparent;
  color: inherit;
}

#stockForm button {
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--a), var(--a2));
  border: none;
  color: #050816;
  cursor: pointer;
}

.ai {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}

.ai:hover {
  background: rgba(148, 163, 184, .15);
}

.weather {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}

.weather:hover {
  background: rgba(148, 163, 184, .15);
}

#settingsBtn {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}

#settingsBtn:hover {
  background: rgba(148, 163, 184, .15);
}

/* Hide all pages unless active */
.page {
  display: none;
}

.page.active {
  display: block;
}


/* ==========================================
   AI PAGE
   ========================================== */

#page-ai.page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Date text */
#page-ai #date {
    margin-bottom: 10px;
    font-weight: bold;
}

/* Chat container */
#page-ai #chat {
    width: 100%;
    max-width: 700px;
    height: 500px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
    overflow-y: auto;
    margin-bottom: 10px;
}

/* Message bubbles — OG AI style */
#page-ai .message {
    margin: 8px 0;
    padding: 12px 14px;
    border-radius: 10px;
    white-space: pre-line;
    line-height: 1.45;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* USER bubble — OG style but theme color */
#page-ai .user {
    background: linear-gradient(110deg, var(--a), var(--a2));
    color: white;
    text-align: right;
    border-top-right-radius: 2px;
}

/* AI bubble — OG style but theme neutral */
#page-ai .ai {
    background: var(--bg);
    text-align: left;
    border-top-left-radius: 2px;
}

/* Input area */
#page-ai #input-area {
    display: flex;
    width: 100%;
    max-width: 700px;
}

/* Input field */
#page-ai #input-area input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--mut);
    border-radius: 8px;
    background: var(--bg);
    color: var(--txt);
}

/* Send button */
#page-ai #input-area button {
    margin-left: 6px;
    padding: 12px 18px;
    border: none;
    background: linear-gradient(110deg, var(--a), var(--a2));
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

#page-ai #input-area button:hover {
    opacity: 0.9;
}

/* Markdown formatting inside AI messages */
#page-ai .ai h3 {
    margin: 10px 0 5px;
    font-size: 1.1em;
}

#page-ai .ai strong {
    font-weight: bold;
}

#page-ai .ai ul {
    padding-left: 20px;
}

#page-ai .ai li {
    margin-bottom: 4px;
}

/* Source card styling — OG look */
#page-ai .source-card {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin: 6px 0;
    border: 1px solid var(--mut);
}

#page-ai .source-card a {
    color: var(--accent);
    text-decoration: none;
}

#page-ai .source-card a:hover {
    text-decoration: underline;
}


/* End Of AI Code */


#translator {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--br);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

body.dark #translator {
  background: rgba(15, 23, 42, 0.85);
}

#translator textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--br);
  background: transparent;
  color: inherit;
  resize: vertical;
  margin-bottom: 10px;
}

#translator select,
#translator button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--br);
  background: var(--bg);
  color: inherit;
  cursor: pointer;
  margin-right: 8px;
}

body.dark #translator select,
body.dark #translator button {
  background: var(--bgd);
}

#translateResult {
  margin-top: 12px;
  padding: 10px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  min-height: 40px;
  white-space: pre-wrap;
}



.temp-toggle {
  position: relative;
  display: inline-block;
}

.toggle-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;   /* match your toggle width */
  height: 26px;  /* match your toggle height */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  pointer-events: none;
}

#tempToggle {
  appearance: none;
  width: 50px;
  height: 26px;
  background: var(--mut);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  vertical-align: middle;
}

#tempToggle:checked {
  background: var(--accent);
}

#tempToggle::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

#tempToggle:checked::before {
  transform: translateX(24px);
}
/* Fixed white on white text*/
body.dark .light-box,
body.dark .light-bg,
body.dark .force-light {
  color: var(--txt);
}
#translator {
  color: var(--txt);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
body.dark #page-ai .ai,
body.dark #page-ai .user {
  color: var(--txt);
}

/*fixed black on black too*/
.force-white {
  color: #fff !important;
}
/* Translator container */
#translator {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg); /* Light or dark background based on theme */
  color: var(--txt);      /* Light or dark text based on theme */
  border: 1px solid var(--br);
  backdrop-filter: blur(10px);
}

/* Translator textarea */
#translateInput {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--br);
  background: var(--bg); /* Match theme background */
  color: var(--txt);      /* Match theme text */
  resize: vertical;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* Translator selects and button */
#translator select,
#translator button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--br);
  background: var(--bg);
  color: var(--txt);
  cursor: pointer;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* Translator result box */
#translateResult {
  margin-top: 12px;
  padding: 10px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  min-height: 40px;
  white-space: pre-wrap;
  color: var(--txt);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

/* Chat System */
#chat-window {
  padding: 10px;
  overflow-y: auto;
  margin-bottom: 10px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  
  width: 100%;
  max-width: 700px;
  height: 500px;
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  margin: 0 auto;
}

.message {
  margin-bottom: 8px;
  line-height: 1.4;
}

.message span.username {
  color: #6aa9ff;
  font-weight: bold;
  margin-right: 6px;
}

#message-input {
  flex: 1;
  padding: .75rem;
  border-radius: 6px;
  border: 1px solid var(--br);
}

#send-button {
  padding: .75rem 1rem;
  background: var(--a);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.message {
  margin-bottom: 8px;
  line-height: 1.4;
}

.message span {
  color: #6aa9ff;
  font-weight: bold;
  margin-right: 6px;
}

#chat-input-row {
  display: flex;
  gap: .5rem;
}

.auth-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.auth-popup.hidden {
  display: none;
}

.auth-box {
  background: white;
  padding: 25px;
  border-radius: 10px;
  width: 300px;
  text-align: center;
}

.auth-box input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
}

.auth-box button {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
}

.close-btn {
  background: #ccc;
  margin-top: 15px;
}

.auth-error {
  color: red;
  margin-top: 10px;
}

#open-login-btn {
  margin-top: 10px;
  margin-right: 10px;
  float: right;
  align-items:right;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}

#open-login-btn:hover {
  background: rgba(148, 163, 184, .15);
}

#logout-btn {
  margin-top: 10px;
  margin-right: 10px;
  float: right;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: .2s;
}

#logout-btn:hover {
  background: rgba(148, 163, 184, .15);
}
#bg-settings {
  padding: 1rem;
  background: #1a1a1a;
  border-radius: 8px;
  color: #eee;
  font-family: 'Inter', sans-serif;
}

#bg-settings label {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
}

#bg-settings input[type="file"],
#bg-settings input[type="text"] {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
}

#bg-settings button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: #00bfa6;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

#bg-settings button:hover {
  background: #009e8e;
}
.news-widget {
  background: #111;
  padding: 1rem;
  border-radius: 8px;
  color: #eee;
  font-family: 'Inter', sans-serif;
}

.news-item {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.news-item a {
  color: #00bfa6;
  text-decoration: none;
}

.news-item a:hover {
  text-decoration: underline;
}
/* Reset default styles */
button, input[type="checkbox"] {
  all: unset;
  box-sizing: border-box;
}

/* 🔘 Button Styling */
button {
  background-color: #1f6feb;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  background-color: #1158c7;
}

button:active {
  transform: scale(0.97);
}

/* 🟩 Checkbox Styling */
input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #999;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
  background-color: #1f6feb;
  border-color: #1f6feb;
}

input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

input[type="checkbox"]:checked::after {
  opacity: 1;
}

/* Optional: Label spacing */
label {
  font-family: 'Segoe UI', sans-serif;
  font-size: 16px;
  color: #222;
  margin-left: 8px;
  cursor: pointer;
}


















