/* ===== Upload Map Image — page styles ===== */

/* --- Page header --- */
.upload-map-page .page-title {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-default);
  letter-spacing: -0.3px;
  text-transform: none;
  font-family: inherit;
  line-height: 1.3;
  display: block;
}
.upload-map-page .page-subtitle {
  margin: 0 0 var(--gap-xl) 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-third);
}

/* --- Layout --- */
.upload-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--gap-l);
  align-items: start;
  margin-bottom: var(--gap-l);
}

/* --- Card --- */
.upload-card {
  background: var(--glass-bg-softer);
  border: 1px solid var(--glass-br-soft);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.upload-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-br-soft);
  background: linear-gradient(135deg, rgba(159, 201, 255, 0.03) 0%, transparent 100%);
}
.upload-card__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(159, 201, 255, 0.1);
  color: #7eb8ff;
  font-size: 16px;
  flex-shrink: 0;
}
.upload-card__icon--info {
  background: rgba(99, 179, 237, 0.1);
  color: #4da6db;
}
.upload-card__icon--pending {
  background: rgba(243, 156, 18, 0.1);
  color: #e8a317;
}
.upload-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-default);
  line-height: 1.3;
}
.upload-card__subtitle {
  font-size: 12px;
  color: var(--text-third);
  margin-top: 2px;
}
.upload-card__body {
  padding: 20px;
}

/* --- Form fields --- */
.upload-field {
  margin-bottom: 20px;
}
.upload-label {
  display: block;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 8px;
  font-size: 13px;
}
.upload-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  background: var(--input-bg-default);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-default);
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.upload-select:focus {
  outline: none;
  border-color: rgba(159, 201, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(159, 201, 255, 0.08);
}

/* --- File uploader zone --- */
.upload-field input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  z-index: -1;
}
.file-uploader {
  position: relative;
}
.uploader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 24px;
  border: 2px dashed rgba(159, 201, 255, 0.15);
  background: linear-gradient(180deg, rgba(159, 201, 255, 0.02) 0%, transparent 100%);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.uploader-inner:hover,
.uploader-inner:focus {
  border-color: rgba(159, 201, 255, 0.35);
  background: linear-gradient(180deg, rgba(159, 201, 255, 0.04) 0%, transparent 100%);
  box-shadow: 0 0 24px rgba(159, 201, 255, 0.04);
}
.file-uploader.drag-hover .uploader-inner {
  border-color: rgba(91, 178, 255, 0.5);
  background: rgba(91, 178, 255, 0.04);
  box-shadow: 0 0 30px rgba(91, 178, 255, 0.08);
  transform: scale(1.005);
}
.uploader-icon i {
  font-size: 44px;
  color: #7eb8ff;
  opacity: 0.6;
  transition: all 0.3s ease;
}
.uploader-inner:hover .uploader-icon i {
  opacity: 0.85;
  transform: translateY(-2px);
}
.uploader-text {
  text-align: center;
}
.uploader-title {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 4px;
}
.uploader-sub {
  color: var(--text-third);
  font-size: 12px;
}
.btn-choose {
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 8px;
  background: rgba(159, 201, 255, 0.1);
  color: var(--text-default);
  border: 1px solid rgba(159, 201, 255, 0.15);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  max-height: none;
}
.btn-choose:hover {
  background: rgba(159, 201, 255, 0.18);
  border-color: rgba(159, 201, 255, 0.3);
  transform: translateY(-1px);
}

/* --- File info bar --- */
.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(159, 201, 255, 0.05);
  border: 1px solid rgba(159, 201, 255, 0.12);
  border-radius: 8px;
}
.file-info__icon {
  font-size: 16px;
  color: #7eb8ff;
  opacity: 0.8;
}
.file-info .file-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- File note --- */
.file-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-third);
  margin-top: 12px;
  background: rgba(99, 179, 237, 0.04);
  border: 1px solid rgba(99, 179, 237, 0.08);
}
.file-note i {
  color: #4da6db;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.file-note code {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 11px;
  color: var(--text-default);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- Submit button (centered) --- */
.upload-actions {
  padding-top: 4px;
  text-align: center;
}
.upload-btn {
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  max-height: none;
}
.upload-btn--primary {
  background: linear-gradient(135deg, var(--btn-bg-default) 0%, rgba(100, 160, 255, 0.9) 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(100, 160, 255, 0.15);
}
.upload-btn--primary:hover {
  box-shadow: 0 4px 16px rgba(100, 160, 255, 0.25);
  transform: translateY(-1px);
}
.upload-btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(100, 160, 255, 0.15);
}
.upload-btn--primary i {
  font-size: 14px;
}

/* --- Preview --- */
#preview {
  position: relative;
  display: none;
  margin-top: 12px;
  max-width: 400px;
}
#preview:not(:empty) {
  display: block;
}
#preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
#preview .preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding: 4px 0;
}
#preview .preview-controls .preview-info {
  font-size: 12px;
  color: var(--text-third);
}
#preview .preview-controls .btn-remove-preview {
  width: auto !important;
  display: inline-flex !important;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  font-weight: 500;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  max-height: none;
}
#preview .preview-controls .btn-remove-preview i {
  font-size: 10px;
}
#preview .preview-controls .btn-remove-preview:hover {
  background: rgba(220, 53, 69, 0.2);
}

/* --- Rules card --- */
.upload-card--rules {
  align-self: start;
}
.upload-card--rules .upload-card__header {
  background: linear-gradient(135deg, rgba(99, 179, 237, 0.03) 0%, transparent 100%);
}
.upload-card--rules .upload-card__body {
  padding: 12px 20px 16px;
}
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rules-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(128, 128, 128, 0.06);
}
.rules-list li:last-child {
  border-bottom: none;
}
.rules-list li i {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(72, 187, 120, 0.1);
  color: #48bb78;
  font-size: 9px;
  flex-shrink: 0;
}

/* --- History card --- */
.upload-card--history .upload-card__header {
  background: linear-gradient(135deg, rgba(159, 201, 255, 0.03) 0%, transparent 100%);
}

/* --- Uploads loading --- */
.uploads-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text-third);
  font-size: 13px;
}
.uploads-loading i {
  font-size: 18px;
  opacity: 0.5;
}

/* --- Uploads empty --- */
.uploads-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text-third);
  text-align: center;
  font-size: 13px;
}
.uploads-empty i {
  font-size: 40px;
  opacity: 0.15;
}

/* --- Upload groups --- */
.uploads-group {
  margin-bottom: 20px;
}
.uploads-group:last-child {
  margin-bottom: 0;
}
.uploads-group__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(128, 128, 128, 0.08);
}
.uploads-group__header i {
  font-size: 14px;
}
.uploads-group--pending .uploads-group__header i { color: #e8a317; }
.uploads-group--approved .uploads-group__header i { color: #48bb78; }
.uploads-group--rejected .uploads-group__header i { color: #dc3545; }

.uploads-group__count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(128, 128, 128, 0.08);
  color: var(--text-third);
}

/* --- Moderation list --- */
.moderation-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.moderation-item {
  display: flex;
  gap: var(--gap-m);
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(128, 128, 128, 0.06);
  border-left: 3px solid rgba(128, 128, 128, 0.1);
  transition: all 0.2s ease;
}
.moderation-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(128, 128, 128, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.moderation-item--pending  { border-left-color: rgba(243, 156, 18, 0.35); }
.moderation-item--approved { border-left-color: rgba(72, 187, 120, 0.35); }
.moderation-item--rejected { border-left-color: rgba(220, 53, 69, 0.35); }
.moderation-item--pending:hover  { border-left-color: rgba(243, 156, 18, 0.6); }
.moderation-item--approved:hover { border-left-color: rgba(72, 187, 120, 0.6); }
.moderation-item--rejected:hover { border-left-color: rgba(220, 53, 69, 0.6); }

.moderation-item--rejected {
  opacity: 0.6;
}
.moderation-item--rejected:hover {
  opacity: 0.8;
}

.moderation-item .thumb {
  width: 130px;
  height: 74px;
  flex: 0 0 130px;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.moderation-item .thumb img.img-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  transition: transform 0.3s ease;
}
.moderation-item:hover .thumb img.img-map {
  transform: scale(1.03);
}
.moderation-item .thumb .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(128, 128, 128, 0.04);
  color: var(--text-third);
  font-size: 20px;
  border-radius: 6px;
  border: 1px dashed rgba(128, 128, 128, 0.1);
}
.moderation-item .info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.moderation-item .info .name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-default);
  line-height: 1.3;
}
.moderation-item .info .game,
.moderation-item .info .date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-third);
}
.moderation-item .info .game::before,
.moderation-item .info .date::before {
  font-family: "Font Awesome 6 Pro";
  font-weight: 400;
  font-size: 11px;
  width: 14px;
  opacity: 0.5;
}
.moderation-item .info .game::before { content: "\f11b"; }
.moderation-item .info .date::before { content: "\f133"; }

/* ===== Toast notifications ===== */
.mw-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.mw-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--glass-bg-softer, #1a1a2e);
  border: 1px solid var(--glass-br-soft, rgba(255,255,255,0.08));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
  min-width: 280px;
  max-width: 420px;
  font-size: 13px;
  color: var(--text-default, #e0e0e0);
  pointer-events: all;
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mw-toast--visible {
  opacity: 1;
  transform: translateX(0);
}
.mw-toast > i {
  font-size: 18px;
  flex-shrink: 0;
}
.mw-toast > span {
  flex: 1;
  line-height: 1.4;
}
.mw-toast__close {
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--text-third, #888);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  max-height: none;
  font-size: 12px;
}
.mw-toast__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-default, #e0e0e0);
}

.mw-toast--success { border-left: 3px solid #48bb78; }
.mw-toast--success > i { color: #48bb78; }
.mw-toast--error   { border-left: 3px solid #dc3545; }
.mw-toast--error > i   { color: #dc3545; }
.mw-toast--warning { border-left: 3px solid #e8a317; }
.mw-toast--warning > i { color: #e8a317; }
.mw-toast--info    { border-left: 3px solid #4da6db; }
.mw-toast--info > i    { color: #4da6db; }

/* ===== Map name modal ===== */
.map-name-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.map-name-modal--open {
  opacity: 1;
  visibility: visible;
}
.map-name-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.map-name-modal__dialog {
  position: relative;
  width: 380px;
  max-width: 90vw;
  padding: 24px;
  background: var(--glass-bg-softer, #1a1a2e);
  border: 1px solid var(--glass-br-soft, rgba(255,255,255,0.08));
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.map-name-modal--open .map-name-modal__dialog {
  transform: scale(1);
}
.map-name-modal__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-default, #e0e0e0);
  margin-bottom: 6px;
}
.map-name-modal__text {
  font-size: 13px;
  color: var(--text-third, #888);
  margin-bottom: 16px;
  line-height: 1.5;
}
.map-name-modal__input {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg-default, rgba(255,255,255,0.05));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-default, #e0e0e0);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}
.map-name-modal__input:focus {
  outline: none;
  border-color: rgba(159, 201, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(159, 201, 255, 0.08);
}
.map-name-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.map-name-modal__btn {
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  max-height: none;
}
.map-name-modal__btn--cancel {
  background: rgba(128, 128, 128, 0.1);
  color: var(--text-secondary, #aaa);
}
.map-name-modal__btn--cancel:hover {
  background: rgba(128, 128, 128, 0.18);
}
.map-name-modal__btn--ok {
  background: var(--btn-bg-default, #4a90d9);
  color: #ffffff;
}
.map-name-modal__btn--ok:hover {
  opacity: 0.88;
}

/* --- Auth required --- */
.auth-required-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 64px 24px;
  text-align: center;
  background: var(--glass-bg-softer);
  border: 1px solid var(--glass-br-soft);
  border-radius: 14px;
  margin: var(--gap-xl) 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.auth-required-block__icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(159, 201, 255, 0.06);
  color: #9fc9ff;
  font-size: 24px;
}
.auth-required-block__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-default);
}
.auth-required-block__text {
  font-size: 13px;
  color: var(--text-third);
  max-width: 320px;
  line-height: 1.55;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .upload-layout {
    grid-template-columns: 1fr;
  }
  .upload-card--rules {
    order: -1;
  }
}
@media (max-width: 767px) {
  .upload-map-page .page-title {
    font-size: 18px;
  }
  .upload-card__header {
    padding: 14px 16px;
  }
  .upload-card__body {
    padding: 16px;
  }
  .uploader-inner {
    padding: 28px 16px;
  }
  .uploader-icon i {
    font-size: 36px;
  }
  .moderation-item {
    flex-direction: column;
    align-items: stretch;
  }
  .moderation-item .thumb {
    width: 100%;
    height: 140px;
    flex: 0 0 auto;
  }
  .mw-toast-container {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .mw-toast {
    min-width: 0;
    max-width: 100%;
  }
}
@media (max-width: 480px) {
  .file-info {
    flex-direction: column;
    align-items: stretch;
  }
  .upload-btn {
    width: 100% !important;
    justify-content: center;
  }
}
