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

.chatgpt-container {
  border: 1px solid #ccc;
  margin: 10px auto;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0px 0px 10px #aaa;
}

.chatgpt-container h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.chatgpt-container form {
  padding: 5px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}

.chatgpt-container input, .ccgpt-input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

.chatgpt-submit, .ccgpt-button {
  background-color: #1fbd7b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 20px;
  transition: background-color 0.3s;
}
.chatgpt-submit:hover, .ccgpt-button:hover {
  background-color: #1d885b;
}
.chatgpt-submit:active, .ccgpt-button:active {
  transform: translateY(2px);
}

.chatgpt-container p {
  margin: 1px;
  font-size: 1rem;
  padding: 0.5em 0;
}

.chatgpt-container .chatgpt-output {
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.chatgpt-container .bot-message, .chatgpt-container .your-message {
  max-width: 85%;
  padding: 10px;
  border-radius: 10px;
  margin: 5px;
  width: fit-content;
}
.chatgpt-container .bot-message {
  background-color: #f2f2f2;
  color: black;
  align-self: flex-start;
}
.chatgpt-container .your-message {
  background-color: #0084ff;
  color: white;
  align-self: flex-end;
}

@keyframes dots {
  0% { content: ""; }
  33% { content: "."; }
  66% { content: ".."; }
  100% { content: "..."; }
}
.chatgpt-container .dots:after {
  display: inline-block;
  animation: dots 1s infinite;
  content: "...";
}

.chatgpt-container .chatgpt-title {
  font-size: 1.6rem;
  font-weight: bold;
  text-align: center;
  background-color: #4267b2;
  color: #ffffff;
  padding: 8px;
  border-radius: 8px 8px 0 0;
}

.chatgpt-container .animate-background {
  animation: background 0.5s ease-in-out infinite alternate;
}
@keyframes background {
  0% { background: #0084ff; }
  50% { background: #86a8c9; }
  100% { background: #f2f2f2; }
}

.chatgpt-container .bot-message pre {
  background-color: #2e3440;
  border-radius: 4px;
  color: #d8dee9;
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  line-height: 1.4;
  margin: 1em 0;
  overflow: auto;
  padding: 0.2em;
  white-space: pre;
}

@media only screen and (max-width: 768px) {
  .chatgpt-container {
    margin: 0;
    padding: 0;
  }
  .chatgpt-container h2 {
    font-size: 20px;
    margin-bottom: 5px;
  }
  .chatgpt-container input, .ccgpt-input {
    padding: 8px;
    font-size: 14px;
    width: 100%;
  }
  .chatgpt-submit, .ccgpt-button {
    font-size: 14px;
  }
  .chatgpt-container .your-message, .chatgpt-container .bot-message {
    max-width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
  }
  .chatgpt-container .chatgpt-title {
    margin-bottom: 10px;
  }
  .chatgpt-container button span {
    display: none;
  }
  #chatgpt-help-form label, #chatgpt-help-form select {
    flex-basis: 100% !important;
    flex: none;
  }
}

#chatgpt-help-form {
  background-color: #f6f6f6;
  border: 1px solid #ccc;
  padding: 5px;
  width: 100%;
  margin: 0 auto;
}
#chatgpt-help-form label, #chatgpt-help-form select {
  display: block;
  margin-bottom: 5px;
}
#chatgpt-help-form textarea {
  display: block;
  width: 100%;
  margin-bottom: 10px;
}
#chatgpt-help-form input[type="submit"] {
  background-color: #2cce8a;
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  border-radius: 5px;
}

#chatgpt-form-output {
  background-color: #fff;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 5px;
  width: 100%;
  margin: 0 auto;
  margin-top: 20px;
}
#chatgpt-form-output b {
  color: #2cce8a;
}

.chatgpt-container .input-group {
  display: flex;
  flex-wrap: wrap;
}
.chatgpt-container .input-field {
  flex: 1;
}

.chatgpt-container button {
  padding: 4px;
}
.chatgpt-container .button-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}
.chatgpt-container .token-alert {
  margin-left: auto;
}

.chatgpt-container .icon {
  display: inline-flex;
  align-self: center;
  height: 16px;
  width: 16px;
}
.chatgpt-container .icon svg, .chatgpt-container .icon img {
  height: 16px;
  width: 16px;
  fill: none;
  /*top: 0.125em;*/
  position: relative;
}

.chatgpt-container .error-container {
  background-color: #ffcccc;
  color: #ff0000;
  font-size: 14px;
  padding: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.chatgpt-container .error-container.active {
  opacity: 1;
  transform: translateY(0);
}

.chatgpt-title {
  background-color: #0a49b3 !important;
}

/* Modal Styles */
.ccgpt-modal, .ccgpt-context-modal, #ccgpt-image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.ccgpt-modal-content, .ccgpt-context-modal-content, #ccgpt-image-modal-content, #ccgpt-modal-content {
  background-color: #9aacc1;
  border: 5px solid #182a4e;
  margin: 15% auto;
  padding: 10px;
  width: 600px;
  max-width: 90%;
  border-radius: 10px;
}

.ccgpt-close, .ccgpt-context-close, .ccgpt-image-close {
  color: #555;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.ccgpt-close:hover, .ccgpt-close:focus, .ccgpt-context-close:hover, .ccgpt-context-close:focus, .ccgpt-image-close:hover, .ccgpt-image-close:focus {
  color: black;
  text-decoration: none;
}

.ccgpt-close-container, .ccgpt-context-close-container {
  display: flex;
  flex-direction: row-reverse;
}

.ccgpt-image-close-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px; /* Optional padding for better spacing */
}

.ccgpt-image-close {
  position: relative;
  right: -3px;
  top: -16px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

.ccgpt-image-modal-title {
  font-size: 20px;
  font-weight: bold;
  color: #0a48b3;
  margin: 0;
}

.ccgpt-modal-title {
  color: #0a48b3;
  font-size: 24px;
  margin-bottom: 10px;
  text-align: center;
}
.ccgpt-modal-description {
  color: #333;
  font-size: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.ccgpt-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ccgpt-label {
  font-size: 16px;
  margin-bottom: 5px;
}

.ccgpt-image-usage-info {
  text-align: center;
  margin-top: 20px;
  font-family: monospace;
}

.ccgpt-progress-bar {
  width: 100%;
  background-color: #c0e4d4;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1px;
}
.ccgpt-progress {
  width: 0%;
  height: 10px;
  background-color: #2dce89;
}

.spinner {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 2s linear infinite;
  margin: 10px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Download Button Styles */
.ccgpt-download-button {
  display: flex;
  align-items: center;
  background-color: #fffefb;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 10px;
  justify-content: space-between;
}
.ccgpt-download-button:hover {
  border: 1px solid #85c2f8;
}

.ccgpt-download-icon {
  width: 70%;
  max-width: 300px;
}

#ccgpt-generated-image {
  border-radius: 8px;
  margin-right: 10px;
  width: 100px;
}

#ccgpt-image-prompt {
  padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-top: 10px;
    background-color: #f6f6f6;
}

#ccgpt-info-text {
  margin-top: 10px;
  font-size: 0.8em;
  background-color: #32486e;
  color: #ffffff;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #0a48b3;
}

.ccgpt-btn {
  display: inline-block !important;
  font-weight: 400 !important;
  text-align: center !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  user-select: none !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  padding: 0.375rem 0.75rem !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  border-radius: 0.25rem !important;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
  cursor: pointer !important;
}

.ccgpt-btn:hover {
  text-decoration: none !important;
}

.ccgpt-btn-primary {
  color: #fff !important;
  background-color: #0a48b3 !important;
  border-color: #0a48b3 !important;
}

.ccgpt-btn-primary:hover {
  color: #fff !important;
  background-color: #083d9b !important;
  border-color: #072c8b !important;
}

.ccgpt-btn-success {
  color: #fff !important;
  background-color: #2dce89 !important;
  border-color: #2dce89 !important;
}

.ccgpt-btn-success:hover {
  color: #fff !important;
  background-color: #28b77a !important;
  border-color: #239e6c !important;
}

.ccgpt-btn-light {
  color: #212529 !important;
  background-color: #f8f9fa !important;
  border-color: #f8f9fa !important;
}

.ccgpt-btn-light:hover {
  color: #212529 !important;
  background-color: #e2e6ea !important;
  border-color: #dae0e5 !important;
}

.ccgpt-btn-sm {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  border-radius: 0.2rem !important;
}

@media (max-width: 768px) {
  .ccgpt-download-button {
    flex-direction: column;
    align-items: center;
  }

  .ccgpt-generated-image {
    margin: 0 0 10px 0;
  }
}
.ced-chatgpt-token-usage {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  font-family: Arial, sans-serif;
}
.ced-chatgpt-usage-title {
  margin-top: 0;
  color: #495057;
  margin-bottom: 10px;
}
.ced-chatgpt-token-info {
  margin-bottom: 10px;
}
.ced-chatgpt-token-ratio {
  font-size: 1.2em;
  font-weight: bold;
  color: #212529;
  margin: 5px 0;
}
.ced-chatgpt-token-progress {
  background-color: #e9ecef;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 5px;
}
.ced-chatgpt-progress-bar {
  background-color: #007bff;
  height: 100%;
  transition: width 0.5s ease-in-out;
}
.ced-chatgpt-token-percentage {
  text-align: right;
  font-size: 0.9em;
  color: #6c757d;
  margin: 0;
}