/* ----------------- Theme Styles ----------------- */
body.theme-light { background-color: #ffffff; color: #000000; }
body.theme-dark { background-color: #121212; color: #e0e0e0; }
body.theme-sepia { background-color: #f4ecd8; color: #5b4636; }
body.theme-contrast { background-color: #000000; color: #ffff00; }
body.theme-grayscale { background-color: #f0f0f0; color: #222; filter: grayscale(100%); }
body.theme-night { background-color: #2e1f1f; color: #ffccaa; filter: brightness(85%) contrast(90%) sepia(20%); }
body.theme-reading { background-color: #fcf9f3; color: #2e2e2e; font-size: 1.15em; line-height: 1.6; max-width: 700px; margin: auto; }
body.theme-solarized-light { background-color: #fdf6e3; color: #657b83; }
body.theme-solarized-dark { background-color: #002b36; color: #839496; }
body.theme-terminal { background-color: #000000; color: #00ff00; font-family: monospace; }
body.theme-warm-beige { background-color: #f5f5dc; color: #3b3b3b; }
body.theme-ocean-blue { background-color: #e0f7fa; color: #006064; }
body.theme-cyberpunk { background-color: #0f0f23; color: #FF00FF; text-shadow: 0 0 5px #0ff; }
body.theme-inverse { background-color: #ffffff; color: #000000; filter: invert(100%); }
body.theme-paper { background-color: #fafafa; color: #111111; box-shadow: inset 0 0 20px rgba(0,0,0,0.05); }

/* ----------------- Responsive Layout Fixes ----------------- */

@media (min-width: 769px) { /* desktop */
  .theme-box label {   display: flex;  align-items: center;  justify-content: space-between;  white-space: nowrap; gap: 1rem;  margin-bottom: 0.5rem;  }
  .theme-box label input[type="color"] {width: 40px;height: 25px; margin: 0; padding: 0; border: none; background: none; flex-shrink: 0; cursor: pointer; }
  #theme-toggle {position: fixed;top: 0px;right: 50px;font-size: 1.5rem;cursor: pointer;z-index: 1000;}
  #theme-panel {
    top: 160px;right: 80px; background: #ffffff; color: #000; border: 1px solid #ccc; padding: 1rem; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.2);
    max-width: 350px; position: fixed; z-index: 999; font-size: 0.95rem; max-height: 80vh; overflow-y: auto; box-sizing: border-box; transition: all 0.3s ease;
  }
  .color-group input[type="color"] { flex-shrink: 0; min-width: 40px; height: 35px; border: none; padding-bottom: -10; background1: none; cursor: pointer;}
}

@media (max-width: 768px) { /* mobile phone */
  .theme-box label { display: flex;align-items: center;justify-content: space-between; margin-bottom: 0.5rem; gap: 1rem; white-space: nowrap;}
  .color-group label {font-size: 0.9rem;}
  .theme-box label input[type="color"] {  width: 40px; height: 25px;  flex-shrink: 0;  margin-left: 0.5rem; appearance: none;   }
  #theme-toggle {position1: fixed !important;top1: 120px !important;right1: 60px important;font-size: 1.5rem;cursor: pointer;z-index: 1000;}
  #theme-panel {margin-bottom: 8px;  
    top: 60px;right: 60px; background: #ffffff; color: #000; border: 1px solid #ccc; padding: 1rem; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.2);
    max-width: 350px; position: fixed; z-index: 999; font-size: 0.95rem; max-height: 80vh; overflow-y: auto; box-sizing: border-box; transition: all 0.3s ease;
  }
  .color-group input[type="color"] { flex-shrink: 0; min-width: 40px; height: 35px; border: none; padding-bottom: -10; background1: none; cursor: pointer;}
}



/* ----------------- Theme Panel Layout ----------------- */




#theme-panel.hidden { display: none;}

.panel-title {
  margin-top: 0;
  font-size: 1.2rem;
  text-align: center;
  font-weight: bold;
}

/* ----------------- Theme Panel Boxes ----------------- */
.theme-box {
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 6px;
    margin-top: -10px;
}

.theme-box h3 {
  margin-top: 0;
}

/* Applies to <select> and color inputs */
.theme-box select,
.theme-box input[type="color"] {
  margin-left: 0.5rem;

}

.theme-box button {
  margin-top: 0.5rem;
  padding: 0.3rem 0.6rem;
  background-color: #eee;
  border: 1px solid #ccc;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ----------------- Close Button ----------------- */
.close-btn {
  display: block;
  margin: 1rem auto 0 auto;
  padding: 0.4rem 1rem;
  background-color: #ddd;
  border: 1px solid #aaa;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
}

.close-btn:hover {
  background-color: #ccc;
}

.color-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 1rem;
}


.color-group label {
  flex-grow: 1;
  white-space: nowrap;
  font-size: 0.9rem;
  max-width: 60%; /* Prevents label from hogging too much space */
}


