/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* General Styles - Dark Theme by Default */
body {
  background-color: #1a1a1a;
  color: #e0e0e0;
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  padding: 20px;
}

body.dark {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

/* Page wrapper for sticky footer */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 40px);
}

#content {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Main Layout */
.main-layout {
  display: flex;
  gap: 30px;
  margin-top: 20px;
}

.colors-panel {
  flex: 0 0 200px;
  min-width: 180px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* Colors Panel */
.colors-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.colors-header label {
  font-weight: 700;
  color: #b0b0b0;
  margin: 0;
}

.btn-add-color {
  background-color: #404040;
  border: none;
  color: #e0e0e0;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-add-color:hover {
  background-color: #505050;
}

#hexColors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-item .hexColor {
  flex: 1;
  border-radius: 6px;
}

.btn-remove-color {
  background-color: transparent;
  border: 1px solid #505050;
  color: #888;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.btn-remove-color:hover {
  background-color: #ff4444;
  border-color: #ff4444;
  color: #fff;
}

/* Presets Section */
.presets-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #333;
}

.presets-section.presets-top {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

.presets-section > label {
  display: block;
  font-weight: 700;
  color: #b0b0b0;
  margin-bottom: 8px;
}

.presets-section .form-control {
  margin-bottom: 8px;
}

.preset-actions {
  display: flex;
  gap: 6px;
}

.btn-preset {
  flex: 1;
  background-color: #404040;
  border: none;
  color: #e0e0e0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-preset:hover {
  background-color: #505050;
}

/* Message Section */
.message-section {
  margin-bottom: 15px;
}

.message-section label {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
  color: #b0b0b0;
}

.message-section .form-control {
  width: 100%;
}

/* Preview Section */
.preview-section {
  margin-bottom: 15px;
}

.preview-section > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #b0b0b0;
}

/* Output Section */
.output-section {
  margin-bottom: 15px;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.output-labels {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.output-labels label {
  margin: 0;
  font-weight: 700;
  color: #b0b0b0;
}

.output-labels .gray {
  font-size: 0.85rem;
  color: #aaaaaa;
  font-weight: 500;
}

.output-format-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.output-format-inline label {
  margin: 0;
  font-weight: 500;
  color: #aaaaaa;
  font-size: 0.9rem;
}

.output-format-inline .form-control {
  width: auto;
  min-width: 150px;
  height: auto;
  padding: 6px 12px;
  line-height: 1.4;
}

/* Formatting Options */
.formatting-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.format-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
}

.format-checkbox input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
}

.format-checkbox label {
  margin: 0;
  color: #b0b0b0;
  line-height: 1;
}

/* Form Controls */
.form-control,
select.form-control {
  background-color: #2d2d2d;
  border: 1px solid #404040;
  color: #e0e0e0;
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.5;
  height: auto;
  min-height: 38px;
}

/* Ensure select dropdowns display text properly */
select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-control:focus {
  background-color: #333333;
  border-color: #555555;
  color: #e0e0e0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(100, 100, 100, 0.3);
}

/* Gray Text */
.gray {
  color: #888888;
}

/* Error Text */
#error {
  color: #ff6b6b;
  display: none;
  margin-top: 5px;
}

/* Scrollbar */
.pp::-webkit-scrollbar {
  display: none;
}

.pp {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Font Faces */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url(./assets/fonts/Quicksand/300.ttf) format('truetype');
}

@font-face {
  font-family: MinecraftRegular;
  src: url(./assets/fonts/MinecraftRegular.otf);
}

@font-face {
  font-family: MinecraftBold;
  src: url(./assets/fonts/MinecraftBold.otf);
}

@font-face {
  font-family: MinecraftItalic;
  src: url(./assets/fonts/MinecraftItalic.otf);
}

@font-face {
  font-family: MinecraftBoldItalic;
  src: url(./assets/fonts/MinecraftBoldItalic.otf);
}

/* Colored Nickname Styles */
#coloredNick {
  font-size: 2.5rem;
  word-wrap: break-word;
  min-height: 50px;
  padding: 10px;
  background-color: #252525;
  border-radius: 6px;
  border: 1px solid #333;
}

/* Minecraft Font Styles */
.minecraft {
  font-family: MinecraftRegular;
}

.minecraftbold {
  font-family: MinecraftBold;
}

.minecraftitalic {
  font-family: MinecraftItalic;
}

.minecraftibold {
  font-family: MinecraftBoldItalic;
}

/* Text Decorations */
.minecraftunderline {
  text-decoration: underline;
}

.minecraftustrike {
  text-decoration: underline line-through;
}

.minecraftstrike {
  text-decoration: line-through;
}

/* Footer Styles */
footer {
  text-align: center;
  padding: 15px;
  color: #888888;
  font-size: 1rem;
}

footer a {
  color: #aaaaaa;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #cccccc;
}

/* Title */
.title-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.title-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

#title {
  background: linear-gradient(to right, #888888, #aaaaaa, #cccccc, #aaaaaa, #888888);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title_animation 6s ease-in-out infinite;
  background-size: 400% 100%;
  margin: 0;
}

@keyframes title_animation {
  0%, 100% {
    background-position: 0 0;
  }
  50% {
    background-position: 100% 0;
  }
}

/* Output Text */
#outputText {
  background-color: #2d2d2d;
  border: 1px solid #404040;
  color: #e0e0e0;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: pre-wrap;
  font-family: MinecraftRegular;
  min-height: 60px;
  margin: 0;
}

#outputText:hover {
  background-color: #333333;
}

#outputText.copied {
  background-color: #2d4a2d;
  border-color: #4a6b4a;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Checkbox Styles */
input[type="checkbox"] {
  margin-right: 5px;
  accent-color: #666666;
}

/* Labels */
label {
  color: #b0b0b0;
}

/* Hide floating circles */
.circles {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }
  
  .colors-panel {
    flex: none;
    width: 100%;
    max-width: none;
  }
  
  #hexColors {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .color-item {
    flex: 0 0 auto;
    width: calc(50% - 4px);
  }
  
  .color-item .hexColor {
    width: 100%;
  }
  
  #coloredNick {
    font-size: 1.8rem;
  }
  
  .output-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .output-format-inline {
    width: 100%;
  }
  
  .output-format-inline .form-control {
    flex: 1;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  #title {
    font-size: 1.6rem;
  }
  
  #coloredNick {
    font-size: 1.4rem;
  }
  
  .color-item {
    width: 100%;
  }
  
  .formatting-options {
    flex-direction: column;
    gap: 8px;
  }
}

/* Ultrawide Display Support */
@media (min-width: 1600px) {
  .container {
    max-width: 1400px;
  }
  
  body {
    padding: 30px;
  }
  
  .main-layout {
    gap: 40px;
  }
  
  .colors-panel {
    flex: 0 0 220px;
    min-width: 200px;
  }
  
  #title {
    font-size: 2.5rem;
  }
  
  .title-logo {
    width: 56px;
    height: 56px;
  }
  
  #coloredNick {
    font-size: 3rem;
    min-height: 60px;
    padding: 15px;
  }
  
  .form-control,
  select.form-control {
    padding: 10px 14px;
    font-size: 1rem;
    min-height: 42px;
  }
  
  select.form-control {
    padding-right: 36px;
    background-position: right 14px center;
  }
  
  #outputText {
    font-size: 1.1rem;
    padding: 12px;
    min-height: 70px;
  }
  
  .message-section label,
  .preview-section > label,
  .output-labels label,
  .colors-header label,
  .presets-section > label {
    font-size: 1.05rem;
  }
  
  .format-checkbox label {
    font-size: 1rem;
  }
  
  .btn-add-color {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  
  .btn-remove-color {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  
  .btn-preset {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  footer {
    font-size: 1.1rem;
    padding: 20px;
  }
}

@media (min-width: 2000px) {
  .container {
    max-width: 1700px;
  }
  
  body {
    padding: 40px;
  }
  
  .main-layout {
    gap: 50px;
  }
  
  .colors-panel {
    flex: 0 0 240px;
    min-width: 220px;
  }
  
  #title {
    font-size: 3rem;
  }
  
  .title-logo {
    width: 64px;
    height: 64px;
  }
  
  .title-container {
    gap: 20px;
    margin-bottom: 15px;
  }
  
  #coloredNick {
    font-size: 3.5rem;
    min-height: 80px;
    padding: 20px;
  }
  
  .form-control,
  select.form-control {
    padding: 12px 16px;
    font-size: 1.1rem;
    border-radius: 8px;
    min-height: 48px;
  }
  
  select.form-control {
    padding-right: 38px;
    background-position: right 14px center;
  }
  
  #outputText {
    font-size: 1.2rem;
    padding: 15px;
    min-height: 80px;
    border-radius: 8px;
  }
  
  .message-section label,
  .preview-section > label,
  .output-labels label,
  .colors-header label,
  .presets-section > label {
    font-size: 1.15rem;
  }
  
  .format-checkbox label {
    font-size: 1.1rem;
  }
  
  .format-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
  
  .btn-add-color {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
  
  .btn-remove-color {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  
  .btn-preset {
    padding: 10px 14px;
    font-size: 15px;
  }
  
  .color-item {
    gap: 8px;
  }
  
  #hexColors {
    gap: 10px;
  }
  
  .message-section,
  .preview-section,
  .output-section {
    margin-bottom: 20px;
  }
  
  .formatting-options {
    gap: 20px;
  }
  
  footer {
    font-size: 1.2rem;
    padding: 25px;
  }
}

@media (min-width: 2560px) {
  .container {
    max-width: 2300px;
  }
  
  body {
    padding: 60px;
  }
  
  .main-layout {
    gap: 70px;
  }
  
  .colors-panel {
    flex: 0 0 280px;
    min-width: 260px;
  }
  
  #title {
    font-size: 4rem;
  }
  
  .title-logo {
    width: 80px;
    height: 80px;
  }
  
  .title-container {
    gap: 28px;
    margin-bottom: 25px;
  }
  
  #coloredNick {
    font-size: 4.5rem;
    min-height: 120px;
    padding: 30px;
    border-radius: 12px;
  }
  
  .form-control,
  select.form-control {
    padding: 16px 20px;
    font-size: 1.3rem;
    border-radius: 10px;
    min-height: 56px;
  }
  
  select.form-control {
    padding-right: 40px;
    background-position: right 16px center;
  }
  
  #outputText {
    font-size: 1.4rem;
    padding: 22px;
    min-height: 120px;
    border-radius: 12px;
  }
  
  .message-section label,
  .preview-section > label,
  .output-labels label,
  .colors-header label,
  .presets-section > label {
    font-size: 1.4rem;
  }
  
  .output-labels .gray {
    font-size: 1.1rem;
  }
  
  .format-checkbox label {
    font-size: 1.3rem;
  }
  
  .format-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
  }
  
  .btn-add-color {
    width: 44px;
    height: 44px;
    font-size: 26px;
    border-radius: 8px;
  }
  
  .btn-remove-color {
    width: 40px;
    height: 40px;
    font-size: 24px;
    border-radius: 8px;
  }
  
  .btn-preset {
    padding: 14px 18px;
    font-size: 18px;
    border-radius: 8px;
  }
  
  .color-item {
    gap: 12px;
  }
  
  .color-item .hexColor {
    border-radius: 10px;
  }
  
  #hexColors {
    gap: 14px;
  }
  
  .message-section,
  .preview-section,
  .output-section {
    margin-bottom: 30px;
  }
  
  .formatting-options {
    gap: 30px;
  }
  
  .presets-section.presets-top {
    margin-bottom: 30px;
    padding-bottom: 25px;
  }
  
  .preset-actions {
    gap: 10px;
  }
  
  footer {
    font-size: 1.4rem;
    padding: 35px;
  }
}

/* Custom Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.modal-container {
  background-color: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 12px;
  padding: 24px;
  width: min(450px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal-container {
  transform: scale(1);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #e0e0e0;
  margin: 0 0 12px 0;
}

.modal-message {
  color: #b0b0b0;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.modal-input {
  width: 100%;
  background-color: #1a1a1a;
  border: 1px solid #404040;
  color: #e0e0e0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 1rem;
  margin-bottom: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-input:focus {
  outline: none;
  border-color: #555555;
  box-shadow: 0 0 0 2px rgba(100, 100, 100, 0.3);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.modal-btn:active {
  transform: scale(0.98);
}

.modal-btn-primary {
  background-color: #505050;
  color: #e0e0e0;
}

.modal-btn-primary:hover {
  background-color: #606060;
}

.modal-btn-secondary {
  background-color: transparent;
  color: #888888;
  border: 1px solid #404040;
}

.modal-btn-secondary:hover {
  background-color: #333333;
  color: #b0b0b0;
}

.modal-btn-danger {
  background-color: #ff4444;
  color: #ffffff;
}

.modal-btn-danger:hover {
  background-color: #ff5555;
}

/* Modal responsive styles */
@media (min-width: 1600px) {
  .modal-container {
    width: min(450px, 90vw);
    padding: 28px;
  }
  
  .modal-title {
    font-size: 1.3rem;
  }
  
  .modal-message {
    font-size: 1.05rem;
  }
  
  .modal-input {
    padding: 12px 16px;
    font-size: 1.05rem;
  }
  
  .modal-btn {
    padding: 12px 24px;
    font-size: 1rem;
  }
}

@media (min-width: 2000px) {
  .modal-container {
    width: min(500px, 90vw);
    padding: 32px;
    border-radius: 14px;
  }
  
  .modal-title {
    font-size: 1.4rem;
  }
  
  .modal-message {
    font-size: 1.1rem;
  }
  
  .modal-input {
    padding: 14px 18px;
    font-size: 1.1rem;
    border-radius: 8px;
  }
  
  .modal-btn {
    padding: 14px 28px;
    font-size: 1.05rem;
    border-radius: 8px;
  }
}

@media (min-width: 2560px) {
  .modal-container {
    width: min(600px, 90vw);
    padding: 40px;
    border-radius: 16px;
  }
  
  .modal-title {
    font-size: 1.6rem;
    margin-bottom: 18px;
  }
  
  .modal-message {
    font-size: 1.25rem;
    margin-bottom: 28px;
  }
  
  .modal-input {
    padding: 18px 22px;
    font-size: 1.25rem;
    border-radius: 12px;
    margin-bottom: 28px;
  }
  
  .modal-btn {
    padding: 18px 36px;
    font-size: 1.15rem;
    border-radius: 12px;
  }
  
  .modal-buttons {
    gap: 14px;
  }
}