*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: #191921;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 15px;
}

.content {
  flex: 1;
  padding: 12px 14px 72px;
  margin: 2px;
}

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

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 5px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-outline-warning {
  background: transparent;
  border: 1px solid #f0a500;
  color: #f0a500;
}

.btn-check:checked + .btn-outline-warning {
  background-color: #f0a500;
  color: #111;
}

.btn-danger  { background-color: #dc3545; color: #fff; }
.btn-warning { background-color: #f0a500; color: #111; font-weight: 600; }
.btn-danger:hover  { background-color: #b02a37; }
.btn-warning:hover { background-color: #d4920a; }

.url-fetcher-section {
  background-color: #1e1e2f;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid #333;
}

.url-fetcher-label {
  color: #aaa;
  font-size: 12px;
  margin-bottom: 6px;
}

.url-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#urlInput {
  flex: 1;
  min-width: 0;
  background-color: #13131d;
  color: #fff;
  border: 1px solid #444;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#urlInput:focus { border-color: #f0a500; }
#urlInput::placeholder { color: #666; }

#fetchBtn {
  background-color: #f0a500;
  color: #111;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

#fetchBtn:hover    { background-color: #d4920a; }
#fetchBtn:disabled { background-color: #555; color: #999; cursor: not-allowed; }

#fetchStatus {
  font-size: 12px;
  margin-top: 5px;
  min-height: 16px;
}

.fetch-error   { color: #ff6b6b; }
.fetch-success { color: #6bff9a; }
.fetch-loading { color: #aaa; }

.image-url-label {
  color: #aaa;
  font-size: 12px;
  margin-bottom: 5px;
}

.image-url-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.image-url-row textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  font-size: 12px;
  padding: 8px 10px;
  color: #ccc;
  background-color: #13131d;
  border: 1px solid #333;
  border-radius: 5px;
  line-height: 1.4;
  word-break: break-all;
}

.btn-copy-image {
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: stretch;
  transition: background-color 0.2s;
}

.btn-copy-image:hover    { background-color: #218838; }
.btn-copy-image:disabled { background-color: #6c757d; cursor: not-allowed; }

.btn-download-image {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: stretch;
  transition: background-color 0.2s;
  margin-left: 5px;
}

.btn-download-image:hover    { background-color: #0056b3; }
.btn-download-image:disabled { background-color: #6c757d; cursor: not-allowed; }

textarea {
  background-color: #1e1e2f;
  color: #ffffff;
  border-radius: 5px;
  padding: 12px;
  width: 100%;
  resize: vertical;
  transition: border-color 0.3s ease;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid #444;
}

textarea.error   { border-color: red; }
textarea.success { border-color: #444; }

.copy-button-container {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-copy {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}

.btn-copy:hover    { background-color: #218838; }
.btn-copy:disabled { background-color: #6c757d; cursor: not-allowed; }

.alert-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-success-custom {
  background-color: #4CAF50;
  color: white;
  border-radius: 5px;
  padding: 12px 15px;
  font-size: 15px;
  margin-top: 6px;
  max-width: 300px;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.5s ease-in-out;
}

footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  background-color: #222222;
  color: #d3d3d3;
  font-size: 13px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .content { padding: 8px 8px 70px; }
  .btn { padding: 8px 10px; font-size: 13px; }
  #fetchBtn { padding: 8px 10px; font-size: 13px; }
  #urlInput { font-size: 13px; padding: 8px; }
  textarea { font-size: 13px; }
  .btn-copy { max-width: none; flex: 1 1 calc(50% - 4px); }
}
