/* ─── Win95 Admin Panel ────────────────────────────────── */

/* ─── Admin Login ──────────────────────────────────────── */
.admin-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #008080;
}

.login-container {
  background: #c0c0c0;
  padding: 0;
  width: 100%;
  max-width: 360px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: 2px 2px 0 #000;
}

.login-container h1 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
  padding: 4px 8px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-container h1::after {
  content: "✕";
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  border: 1px solid #fff;
  background: #c0c0c0;
  color: #000;
}

.login-error {
  background: #fff;
  color: #cc0000;
  padding: 8px;
  margin: 8px;
  border: 2px inset #808080;
  font-size: 12px;
  font-weight: 700;
}

.login-form {
  padding: 12px;
}

.login-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  color: #000;
}

.login-form input {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 4px 6px;
  border: 2px inset #808080;
  background: #fff;
  font-size: 13px;
  font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
}

.login-form input:focus {
  outline: 1px solid #000;
}

.login-form button {
  width: 100%;
  padding: 6px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: #c0c0c0;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
  font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
}

.login-form button:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* ─── Admin Layout ─────────────────────────────────────── */
.admin-page {
  background: #c0c0c0;
  min-height: 100vh;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: #c0c0c0;
  border-bottom: 2px solid #808080;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-header h1 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
  padding: 4px 10px;
  margin: 0;
}

.admin-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.admin-btn {
  display: inline-block;
  padding: 4px 14px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: #c0c0c0;
  font-size: 12px;
  font-weight: 700;
  color: #000;
  text-decoration: none;
  font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
}

.admin-btn:hover {
  background: #e8e8e8;
  text-decoration: none;
  color: #000;
}

.admin-btn:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.admin-btn-sm {
  padding: 2px 8px;
  font-size: 11px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: #c0c0c0;
  color: #000;
  font-weight: 700;
  text-decoration: none;
  font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
  display: inline-block;
}

.admin-btn-sm:hover {
  background: #e8e8e8;
  text-decoration: none;
}

.admin-btn-primary {
  background: #c0c0c0;
  font-weight: 900;
}

.admin-btn-danger {
  background: #c0c0c0;
  color: #cc0000;
  font-weight: 900;
}

.admin-btn-danger.admin-btn-sm {
  color: #cc0000;
}

/* ─── Admin Layout (Dashboard) ─────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 8px;
  padding: 8px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

.admin-posts, .admin-files {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 0;
}

.admin-posts h2, .admin-files h2 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
  padding: 4px 8px;
  margin: 0;
}

/* ─── Admin Table ──────────────────────────────────────── */
.admin-table {
  width: 100%;
  font-size: 12px;
}

.admin-table th {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 2px solid #808080;
  background: #c0c0c0;
  color: #000;
  font-weight: 700;
  font-size: 11px;
}

.admin-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #808080;
  background: #fff;
}

.row-draft {
  opacity: 0.7;
}

.row-draft td:first-child::before {
  content: "📝 ";
}

.admin-actions {
  display: flex;
  gap: 4px;
}

/* ─── File Upload ──────────────────────────────────────── */
.file-upload-form {
  padding: 8px;
  background: #fff;
  border: 2px inset #808080;
  margin: 8px;
}

.file-upload-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #000;
}

.file-upload-form input {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 3px 6px;
  border: 2px inset #808080;
  background: #fff;
  font-size: 12px;
  font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
}

.file-upload-form input[type="file"] {
  padding: 2px;
}

.file-browser {
  max-height: 400px;
  overflow-y: auto;
  padding: 4px 8px;
}

.file-folder {
  margin-bottom: 8px;
}

.file-folder h3, .file-folder h4 {
  font-size: 12px;
  font-weight: 700;
  color: #000080;
  margin-bottom: 4px;
}

.file-folder ul {
  padding-left: 12px;
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
  flex-wrap: wrap;
}

.file-meta {
  color: #808080;
  font-size: 10px;
}

.copy-address-btn {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  font-size: 11px;
  cursor: pointer;
  padding: 1px 4px;
}

.copy-address-btn:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* ─── File Item Layout ─────────────────────────────────── */
.file-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
  flex-wrap: nowrap;
}

.file-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-item-name {
  word-break: break-all;
}

.file-item-name a {
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: #000080;
}

.file-item-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
}

/* ─── File Thumbnails ──────────────────────────────────── */
.file-thumbnail {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  background: #fff;
  padding: 1px;
  flex-shrink: 0;
}

/* ─── File Delete Button ───────────────────────────────── */
.file-delete-btn {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  font-size: 13px;
  cursor: pointer;
  padding: 1px 5px;
  line-height: 1;
}

.file-delete-btn:hover {
  background: #cc0000;
  color: #fff;
}

.file-delete-btn:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* ─── File Rename Button ───────────────────────────────── */
.file-rename-btn {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  font-size: 13px;
  cursor: pointer;
  padding: 1px 5px;
  line-height: 1;
}

.file-rename-btn:hover {
  background: #000080;
  color: #fff;
}

.file-rename-btn:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* ─── File Rename Input ────────────────────────────────── */
.file-rename-row {
  margin-top: 2px;
}

.rename-form {
  display: flex;
  gap: 2px;
  align-items: center;
}

.file-rename-input {
  padding: 2px 4px;
  border: 2px inset #808080;
  background: #fff;
  font-size: 11px;
  font-family: "Courier New", monospace;
  width: 180px;
}

.file-rename-input:focus {
  outline: 1px solid #000;
}

.file-rename-save {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  font-size: 12px;
  cursor: pointer;
  padding: 1px 4px;
}

.file-rename-save:hover {
  background: #008000;
  color: #fff;
}

.file-rename-cancel {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  font-size: 12px;
  cursor: pointer;
  padding: 1px 4px;
  color: #cc0000;
  font-weight: 700;
}

.file-rename-cancel:hover {
  background: #cc0000;
  color: #fff;
}

/* ─── Editor Layout ────────────────────────────────────── */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 8px;
  padding: 8px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

.editor-form {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 8px;
}

.editor-fields {
  border: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  padding: 8px;
  margin-bottom: 8px;
  background: #c0c0c0;
}

.editor-fields legend {
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  background: #000080;
  padding: 2px 8px;
}

.field-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.field-row label {
  flex: 1;
  min-width: 160px;
  font-size: 12px;
  font-weight: 700;
  color: #000;
}

.field-row input {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 3px 6px;
  border: 2px inset #808080;
  background: #fff;
  font-size: 12px;
  font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  flex: 0 !important;
  min-width: auto !important;
  padding-top: 18px;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.editor-label {
  display: block;
  font-weight: 700;
  font-size: 12px;
  color: #000;
  margin-bottom: 8px;
}

.editor-label textarea {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 6px;
  border: 2px inset #808080;
  background: #fff;
  font-family: "Courier New", "Lucida Console", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  tab-size: 2;
}

.editor-label textarea:focus {
  outline: 1px solid #000;
}

.editor-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ─── Editor Sidebar ───────────────────────────────────── */
.editor-sidebar {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 0;
  position: sticky;
  top: 8px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  font-size: 12px;
}

.editor-sidebar h3 {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #000080, #1084d0);
  padding: 4px 8px;
  margin: 0;
}

.editor-sidebar .file-folder {
  padding: 4px 8px;
}

.insert-file-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid #808080;
  font-size: 11px;
  font-family: "Courier New", monospace;
  color: #000080;
  cursor: pointer;
}

.insert-file-btn:hover {
  background: #000080;
  color: #fff;
}

.editor-shortcuts {
  padding: 8px;
  font-size: 11px;
  color: #000;
  line-height: 1.8;
  border-top: 2px solid #808080;
  margin-top: 4px;
}

.editor-shortcuts code {
  background: #fff;
  padding: 1px 4px;
  border: 1px solid #808080;
  font-size: 11px;
  color: #000080;
}

/* ─── Collapsible Folder Headers ───────────────────────── */
.file-folder-collapsible {
  margin-bottom: 4px;
}

.file-folder-header {
  cursor: pointer;
  user-select: none;
  padding: 4px 6px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: #c0c0c0;
  font-size: 12px;
  font-weight: 700;
  color: #000080;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.file-folder-header:hover {
  background: #000080;
  color: #fff;
}

.folder-toggle {
  font-size: 10px;
  width: 12px;
  display: inline-block;
}

.folder-count {
  font-size: 10px;
  color: #808080;
  font-weight: 400;
  margin-left: auto;
}

.file-folder-header:hover .folder-count {
  color: #fff;
}

.admin-files-link {
  font-size: 11px;
  font-weight: 400;
  color: #fff;
  margin-left: 12px;
  text-decoration: underline;
}

.admin-files-link:hover {
  color: #ffff00;
}

/* ─── File Manager Layout ──────────────────────────────── */
.file-manager {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px;
}

/* ─── Upload Row ───────────────────────────────────────── */
.upload-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.upload-row label {
  flex: 1;
  min-width: 120px;
  margin-bottom: 0;
}

.upload-row button {
  flex-shrink: 0;
}

/* ─── Breadcrumbs ──────────────────────────────────────── */
.file-breadcrumbs {
  padding: 6px 8px;
  font-size: 12px;
  color: #000;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.file-breadcrumbs a {
  color: #000080;
  font-weight: 700;
  text-decoration: none;
}

.file-breadcrumbs a:hover {
  color: #000;
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #808080;
  font-weight: 700;
}

.breadcrumb-current {
  color: #000;
  font-weight: 700;
}

/* ─── File Grid ────────────────────────────────────────── */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.file-card {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: #000;
  min-height: 140px;
  position: relative;
}

.file-card-folder {
  cursor: pointer;
}

.file-card-folder:hover {
  background: #000080;
  color: #fff;
  text-decoration: none;
}

.file-card-folder:hover .file-card-name,
.file-card-folder:hover .file-card-meta {
  color: #fff;
}

.file-card-icon {
  font-size: 48px;
  line-height: 1;
  margin: 8px 0;
}

.file-card-preview {
  width: 100%;
  height: 100px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px inset #808080;
  margin-bottom: 4px;
}

.file-card-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-card-name {
  font-size: 11px;
  font-weight: 700;
  word-break: break-all;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card-meta {
  font-size: 10px;
  color: #808080;
}

.file-card-actions {
  display: flex;
  gap: 2px;
  margin-top: auto;
  padding-top: 4px;
  opacity: 0;
  transition: opacity 0.1s;
}

.file-card:hover .file-card-actions {
  opacity: 1;
}

.file-card-rename {
  width: 100%;
  margin-top: 4px;
}

.file-card-rename .rename-form {
  display: flex;
  gap: 2px;
  justify-content: center;
}

.file-card-rename .file-rename-input {
  width: 120px;
  font-size: 10px;
  padding: 2px 3px;
}

/* ─── Responsive File Grid ─────────────────────────────── */
@media (max-width: 600px) {
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 4px;
  }

  .file-card {
    min-height: 110px;
    padding: 4px;
  }

  .file-card-icon {
    font-size: 36px;
  }

  .file-card-preview {
    height: 70px;
  }

  .file-card-actions {
    opacity: 1;
  }
}