/* Gcode to FFF Converter Styles */

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, royalblue 0%, rebeccapurple 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

/* Storage Information Notices */
.storage-info {
  margin-top: 15px;
  padding: 0;
}

.guest-notice,
.user-notice {
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.9em;
  text-align: center;
  margin-bottom: 10px;
}

.guest-notice {
  background: mistyrose;
  border: 1px solid lightcoral;
  color: darkred;
}

.user-notice {
  background: honeydew;
  border: 1px solid lightgreen;
  color: darkgreen;
}

.guest-notice a,
.user-notice a {
  color: inherit;
  font-weight: bold;
  text-decoration: underline;
}

/* User info bar */
.user-bar {
  background: white;
  border-radius: 10px;
  padding: 10px 20px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-info {
  font-size: 0.95em;
  color: dimgray;
}

.user-info strong {
  color: royalblue;
}

.user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.files-btn {
  padding: 6px 12px;
  width: 70px;
  background: cornflowerblue;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  text-decoration: none;
  text-align: center;
}

.files-btn:hover {
  background: royalblue;
}

.logout-btn {
  padding: 6px 12px;
  width: 70px;
  background: mediumseagreen;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  text-decoration: none;
}

.logout-btn:hover {
  background: seagreen;
}

.change-password-btn {
  padding: 6px 12px;
  background: slateblue;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  text-decoration: none;
}

.change-password-btn:hover {
  background: darkslateblue;
}

/* Main Container */
.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, cornflowerblue 0%, mediumpurple 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2em;
  margin-bottom: 10px;
}

.header p {
  opacity: 0.9;
  font-size: 1.1em;
}

.content {
  padding: 40px;
}

/* Upload Area */
.upload-area {
  margin-bottom: 30px;
}

.file-input-group {
  margin-bottom: 25px;
}

.file-input-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: darkgray;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: whitesmoke;
  border: 2px dashed gainsboro;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-input-label:hover {
  background: whitesmoke;
  border-color: royalblue;
}

.file-input-label.has-file {
  background: honeydew;
  border-color: mediumseagreen;
  border-style: solid;
}

.file-input-label svg {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  fill: dimgray;
}

.file-input-label.has-file svg {
  fill: mediumseagreen;
}

.file-name {
  color: dimgray;
  font-size: 0.95em;
}

.file-input-label.has-file .file-name {
  color: forestgreen;
  font-weight: 500;
}

/* Options */
.options-group {
  margin-bottom: 25px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
}

.checkbox-wrapper label {
  cursor: pointer;
  user-select: none;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  flex: 1;
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, royalblue 0%, rebeccapurple 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(65, 105, 225, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: whitesmoke;
  color: dimgray;
}

.btn-secondary:hover {
  background: gainsboro;
}

/* Status Messages */
.status-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
  display: none;
}

.status-message.show {
  display: block;
}

.status-message.success {
  background: honeydew;
  color: darkgreen;
  border: 1px solid lightgreen;
}

.status-message.error {
  background: mistyrose;
  color: darkred;
  border: 1px solid lightcoral;
}

.status-message.info {
  background: aliceblue;
  color: darkblue;
  border: 1px solid lightblue;
}

.status-message.warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Results */
.results {
  margin-top: 20px;
  margin-bottom: 0px;
  padding-top: 15px;
  border-top: 2px solid lightgray;
  display: none;
  background: white;
  border-radius: 10px;
  padding: 5px;
}

.results.show {
  display: block;
}

.results h3 {
  margin-bottom: 5px;
  color: darkslategray;
}

.result-item {
  background: whitesmoke;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-item .filename {
  font-weight: 500;
  color: darkslategray;
}

.result-item .download-btn {
  padding: 8px 16px;
  background: mediumseagreen;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.3s ease;
}

.result-item .download-btn:hover {
  background: seagreen;
}

/* Loading Spinner */
.loading {
  display: none;
  text-align: center;
  margin: 20px 0;
}

.loading.show {
  display: block;
}

.spinner {
  border: 3px solid whitesmoke;
  border-top: 3px solid royalblue;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Debug Output */
.debug-output {
  margin-top: 5px;
  padding: 10px;
  background: whitesmoke;
  border-radius: 10px;
  display: none;
}

.debug-output.show {
  display: block;
}

.debug-output h4 {
  margin-bottom: 15px;
  color: darkslategray;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debug-output pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  color: darkslategray;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
}

.debug-download-btn {
  padding: 8px 16px;
  background: mediumseagreen;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.3s ease;
}

.debug-download-btn:hover {
  background: seagreen;
}

/* Modal Styles */
.modal {
  display: none !important;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal[style*="block"] {
  visibility: visible !important;
  opacity: 1 !important;
}

.modal.show {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: translateY(-50px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  background: linear-gradient(135deg, cornflowerblue 0%, mediumpurple 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  flex: 1;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bulk-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.8em;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transition: background 0.3s ease;
}

.bulk-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bulk-btn.delete-bulk {
  background: rgba(220, 20, 60, 0.8);
}

.bulk-btn.delete-bulk:hover {
  background: darkred;
}

.bulk-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  opacity: 0.5;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  opacity: 0.8;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.file-item {
  background: whitesmoke;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.file-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: darkslategray;
  margin-bottom: 4px;
}

.file-details {
  font-size: 0.85em;
  color: gray;
}

.file-actions {
  display: flex;
  gap: 8px;
  align-self: flex-end;
}

.file-download-btn {
  padding: 8px 16px;
  background: mediumseagreen;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.3s ease;
}

.file-download-btn:hover {
  background: seagreen;
}

.file-delete-btn {
  padding: 8px 16px;
  background: rgba(220, 20, 60, 0.8);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.3s ease;
}

.file-delete-btn:hover {
  background: darkred;
}

.file-delete-btn:disabled {
  background: lightgray;
  cursor: not-allowed;
}

.empty-files {
  text-align: center;
  color: gray;
  font-style: italic;
  padding: 40px 20px;
}

.file-type-fff {
  border-left: 4px solid mediumseagreen;
}

.file-type-txt {
  border-left: 4px solid cornflowerblue;
}

.file-type-other {
  border-left: 4px solid gray;
}

/* Password Change Modal Styles */
#changePasswordModal .modal-content {
  max-width: 500px;
}

#changePasswordModal .form-group {
  margin-bottom: 20px;
}

#changePasswordModal label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: dimgray;
}

#changePasswordModal input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid lightgray;
  border-radius: 5px;
  font-size: 0.95em;
  transition: border-color 0.3s ease;
}

#changePasswordModal input[type="password"]:focus {
  outline: none;
  border-color: cornflowerblue;
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.8em;
  color: gray;
  font-style: italic;
}

.password-message {
  margin: 15px 0;
  padding: 10px;
  border-radius: 5px;
  font-size: 0.9em;
  display: none;
}

.password-message.success {
  background: honeydew;
  border: 1px solid lightgreen;
  color: darkgreen;
}

.password-message.error {
  background: mistyrose;
  border: 1px solid lightcoral;
  color: darkred;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}