@charset "UTF-8";
:root {
  --background-color: #121212;
  --surface-color: #1e1e1e;
  --primary-text-color: #e0e0e0;
  --secondary-text-color: #a0a0a0;
  --border-color: #333333;
  --primary-accent-color: #03dac6;
  --secondary-accent-color: #bb86fc;
  --highlight-color: #ffc107;
  --success-color: #00876c;
  --danger-color: #e53935;
  --button-primary-bg: var(--secondary-accent-color);
  --button-primary-text: #000000;
}

body {
  background-color: var(--background-color);
  color: var(--primary-text-color);
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 20px;
  line-height: 1.6;
  font-feature-settings: "calt" off;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

h1,
h2 {
  color: #ffffff;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  margin-top: 30px;
}

h1 {
  font-size: 2.5em;
}

h2 {
  font-size: 1.8em;
}

p {
  margin-bottom: 15px;
}

a {
  color: var(--primary-accent-color);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--secondary-accent-color);
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 30px 0;
}

/* --- Button Styles --- */
.button-primary,
.button-secondary,
.button-danger {
  display: inline-block;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.button-primary {
  background-color: var(--button-primary-bg);
  color: var(--button-primary-text);
}
.button-primary:hover {
  background-color: #a16ae8;
  text-decoration: none;
}

.button-secondary {
  background-color: #333;
  color: var(--primary-text-color);
}
.button-secondary:hover {
  background-color: #444;
  text-decoration: none;
}

.button-danger {
  background-color: var(--danger-color);
  color: white;
}
.button-danger:hover {
  background-color: #c62828;
  text-decoration: none;
}

/* --- Toggle Switch --- */
.toggle-switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
  color: var(--secondary-text-color);
  white-space: nowrap;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-accent-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--secondary-text-color);
}

input[type=text],
input[type=url],
input[type=email],
input[type=password],
textarea {
  width: 100%;
  padding: 12px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--primary-text-color);
  font-size: 1em;
  box-sizing: border-box;
}
input[type=text]:focus,
input[type=url]:focus,
input[type=email]:focus,
input[type=password]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-accent-color);
  box-shadow: 0 0 5px var(--primary-accent-color);
}

textarea {
  resize: vertical;
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 15px;
}
.form-group-inline > label {
  margin-bottom: 0;
  text-align: right;
  flex-shrink: 0;
  width: 160px;
}

.form-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.form-group-header > label {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  margin-top: 25px;
}
.form-actions #show-app-list-btn {
  margin-left: auto;
}

/* --- File Operations --- */
.file-operations {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-operation-item {
  flex-shrink: 0;
}

/* --- Download Link Input Group --- */
.link-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}
.link-input-group.is-separator-group {
  border-bottom: 2px solid var(--primary-accent-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
}
.link-input-group.is-separator-group .separator-link-btn {
  background-color: var(--primary-accent-color);
  color: black;
  font-weight: bold;
}

.link-name-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.link-name-wrapper:focus-within {
  border-color: var(--primary-accent-color);
  box-shadow: 0 0 5px var(--primary-accent-color);
}
.link-name-wrapper .link-preview-icon {
  height: 20px;
  width: 20px;
  -o-object-fit: contain;
     object-fit: contain;
  flex-shrink: 0;
}
.link-name-wrapper input.link-name {
  flex-grow: 1;
  border: none;
  padding: 12px 0;
  background-color: transparent;
  outline: none;
  box-shadow: none;
  width: auto;
}

input.link-url {
  flex: 3;
}

.remove-link-btn {
  background-color: #555;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
}
.remove-link-btn:hover {
  background-color: var(--danger-color);
}

.separator-link-btn {
  background-color: #333;
  color: var(--primary-text-color);
  border: 1px solid #555;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 5px;
}
.separator-link-btn:hover {
  background-color: #444;
  border-color: var(--primary-accent-color);
}

/* --- Grid Size Controls --- */
.grid-size-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.9em;
  color: var(--secondary-text-color);
}
.grid-size-controls span {
  white-space: nowrap;
}
.grid-size-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
  color: var(--primary-text-color);
}
.grid-size-controls input[type=radio] {
  margin: 0;
  accent-color: var(--primary-accent-color);
}
.grid-size-controls input[type=text] {
  width: 80px;
  padding: 6px 8px;
  font-size: 0.9em;
  height: auto;
}

/* --- ID Input --- */
.id-input-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-grow: 1;
}
.id-input-wrapper input {
  flex-grow: 1;
}

#get-current-time-btn {
  padding: 12px 15px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* --- App List & Table --- */
.app-list-manager {
  margin-top: 30px;
}
.app-list-manager.hidden {
  display: none;
}

.list-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
.list-controls select,
.list-controls input {
  padding: 8px 12px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--primary-text-color);
}

#search-input {
  width: 250px;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  table-layout: fixed;
}
.app-table th,
.app-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-table th {
  background-color: #2a2a2a;
  font-weight: 700;
}
.app-table .col-actions a {
  margin-left: 10px;
  cursor: pointer;
}
.app-table .col-name {
  width: 25%;
}
.app-table .col-id {
  width: 18%;
}
.app-table .col-version {
  width: 10%;
}
.app-table .col-updated {
  width: 15%;
}
.app-table .col-password {
  width: 12%;
}
.app-table .col-actions {
  width: 20%;
  text-align: right;
}

.pagination-controls {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.pagination-controls .button-secondary {
  padding: 8px 15px;
}

.info-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}
.info-card ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}
.info-card li {
  padding: 5px 0;
}
.info-card div {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.highlight-password {
  color: var(--highlight-color);
  font-weight: 700;
  background-color: rgba(255, 193, 7, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}
.highlight-password:hover {
  background-color: rgba(255, 193, 7, 0.25);
}
.highlight-password.copied {
  background-color: var(--success-color);
  color: white;
  cursor: default;
}

.download-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.download-links-separator {
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
  margin: 25px 0;
}

.download-grid-item {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  transition: background-color 0.3s, transform 0.2s, border-color 0.3s;
  text-decoration: none;
  color: var(--primary-text-color);
  min-height: 80px;
}
.download-grid-item:hover {
  background-color: #2a2a2a;
  transform: translateY(-5px);
  border-color: var(--primary-accent-color);
  text-decoration: none;
  color: var(--primary-accent-color);
}

.download-grid-icon {
  height: 36px;
  width: 36px;
  -o-object-fit: contain;
     object-fit: contain;
  margin-right: 15px;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 5px;
  box-sizing: border-box;
}

.download-grid-text {
  font-size: 1.1em;
  font-weight: 500;
  line-height: 1.3;
}

.app-list {
  list-style: none;
  padding: 0;
}
.app-list li a {
  display: block;
  padding: 15px;
  background-color: var(--surface-color);
  margin-bottom: 10px;
  border-radius: 8px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.app-list li a:hover {
  background-color: #2a2a2a;
  transform: translateX(5px);
  text-decoration: none;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.modal-overlay {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: initial;
  /* Bỏ align-items: center để có thể tùy chỉnh vị trí */
  cursor: default;
}

.modal-content {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  animation: slide-down 0.3s ease-out;
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.5em;
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-body .download-grid-item {
  cursor: default;
}
.modal-body .download-grid-item:hover {
  transform: none;
  border-color: var(--border-color);
  color: var(--primary-text-color);
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 2em;
  font-weight: bold;
  color: var(--secondary-text-color);
  cursor: pointer;
  padding: 0 10px;
  line-height: 1;
}
.close-modal-btn:hover {
  color: var(--primary-text-color);
}

/* --- Modal Xem Trước Giao Diện --- */
#preview-modal .modal-content {
  position: absolute;
  max-width: 1065px;
}

#preview-modal .modal-header {
  cursor: move;
}

.modal-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background: repeating-linear-gradient(-45deg, transparent, transparent 4px, var(--border-color) 4px, var(--border-color) 5px);
}

#preview-layout-btn.fab-preview {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--secondary-accent-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s ease, transform 0.2s ease;
}
#preview-layout-btn.fab-preview:hover {
  background-color: #a16ae8;
  transform: translateY(-3px);
}

/* --- Modal Thông Báo Tùy Chỉnh --- */
#custom-modal-overlay {
  z-index: 2000;
}

#custom-modal-content {
  animation: slide-down 0.3s ease-out;
  max-width: 480px;
  text-align: center;
}

#custom-modal-header {
  justify-content: center;
}

#custom-modal-body p {
  margin: 0;
  font-size: 1.05em;
  line-height: 1.7;
  white-space: pre-wrap;
}

#custom-modal-input {
  display: none;
  width: 100%;
  margin-top: 15px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: #2a2a2a;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

body.login-active {
  background-color: #1e1e2d;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}
body.login-active #preview-layout-btn {
  display: none;
}

#login-container {
  background-color: #2d3047;
  padding: 35px 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: none;
  margin: 0;
}
#login-container h1,
#login-container .form-group {
  display: none;
}

.login-header {
  text-align: center;
  color: var(--primary-text-color, #ffffff);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-header svg {
  margin-right: 10px;
  fill: #e0e0e0;
}

#login-form input[type=email],
#login-form input[type=password] {
  width: 100%;
  background-color: #1e1e2d;
  border: 1px solid #40435a;
  color: var(--primary-text-color, #ffffff);
  padding: 14px;
  margin-bottom: 15px;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}
#login-form input[type=email]::-moz-placeholder, #login-form input[type=password]::-moz-placeholder {
  color: var(--secondary-text-color, #a0a0a0);
}
#login-form input[type=email]::placeholder,
#login-form input[type=password]::placeholder {
  color: var(--secondary-text-color, #a0a0a0);
}
#login-form input[type=email]:focus,
#login-form input[type=password]:focus {
  outline: none;
  border-color: #3d84f7;
  box-shadow: none;
}
#login-form .button-primary {
  width: 100%;
  margin-top: 10px;
  background-color: #3d84f7;
  color: white;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}
#login-form .button-primary:hover {
  background-color: #2a6fdf;
}

#login-error {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
  color: #e53935 !important;
  min-height: 1em;
}

/* --- Page Loader --- */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #1e1e2d;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loader-spinner {
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-left-color: #ffffff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* --- Output & Copy Box --- */
.output-box {
  background-color: var(--surface-color);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.output-box h2 {
  margin-top: 0;
  font-size: 1.5em;
  border-bottom: 1px solid var(--border-color);
}

.copy-wrapper {
  position: relative;
  display: flex;
}
.copy-wrapper input[readonly] {
  flex-grow: 1;
  background-color: #0d0d0d;
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  cursor: pointer;
}
.copy-wrapper input[readonly]:hover {
  border-color: var(--primary-accent-color);
}
.copy-wrapper textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: "Courier New", Courier, monospace;
  background-color: #0d0d0d;
}

.copy-btn {
  padding: 10px 15px;
  background-color: #444;
  color: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}
.copy-btn:hover {
  background-color: var(--primary-accent-color);
  color: black;
}
.copy-btn:disabled {
  background-color: var(--success-color);
  color: white;
  cursor: default;
}

.copy-wrapper > input + .copy-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}

.copy-wrapper > textarea + .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
}

/* --- ID Exists Warning Animation --- */
#appId.id-exists-warning {
  border-color: var(--danger-color) !important;
  animation: pulse-warning 1s infinite;
}

@keyframes pulse-warning {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7);
  }
  70% {
    box-shadow: 0 0 3px 5px rgba(229, 57, 53, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
  }
}
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  .container {
    padding: 10px;
  }
  h1 {
    font-size: 1.8em;
  }
  h2 {
    font-size: 1.4em;
  }
  .button-primary,
  .button-secondary,
  .button-danger {
    padding: 10px 15px;
    font-size: 0.9em;
  }
  /* --- Form quản trị --- */
  .form-group-inline {
    flex-direction: column;
    align-items: flex-start;
  }
  .form-group-inline > label {
    width: auto;
    text-align: left;
    margin-bottom: 5px;
  }
  .file-operations {
    flex-direction: column;
    gap: 10px;
  }
  /* --- Nút download --- */
  .download-grid-item {
    flex-direction: column;
    text-align: center;
    padding: 15px;
    min-height: auto;
    box-sizing: border-box;
    min-width: 0;
  }
  .download-grid-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }
  .download-grid-text {
    font-size: 1em;
    word-break: break-word;
  }
}
@media (max-width: 490px) {
  .download-links {
    grid-template-columns: 1fr !important;
  }
}/*# sourceMappingURL=style.css.map */