/* ============================================
   Resources Page Styles
   ============================================ */

/* ---- Admin Gate ---- */
.admin-gate {
  text-align: center;
  padding: 40px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.admin-gate-icon { font-size: 36px; margin-bottom: 10px; }
.admin-gate-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.admin-gate-hint { font-size: 12px; color: var(--text-light); margin-bottom: 16px; }
.admin-input-group {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}
.admin-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.admin-input:focus { border-color: var(--accent); }
.auth-error {
  margin-top: 10px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 500;
}

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--surface);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.upload-zone .upload-icon { font-size: 40px; margin-bottom: 10px; }
.upload-zone .upload-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-zone .upload-hint { font-size: 12px; color: var(--text-light); margin-bottom: 16px; }

/* ---- File Preview ---- */
.upload-preview {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
}
.preview-file-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.preview-file-icon { font-size: 32px; }
.preview-name { font-size: 14px; font-weight: 600; }
.preview-size { font-size: 12px; color: var(--text-light); }

.upload-meta-form {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---- File Cards ---- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.file-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.file-icon { font-size: 28px; flex-shrink: 0; }
.file-card-info { flex: 1; min-width: 0; }
.file-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-originalname { font-size: 12px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-type-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.file-card-body { padding: 14px 20px; flex: 1; display: flex; flex-direction: column; }
.file-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; flex: 1; }

.file-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.file-meta-item { font-size: 12px; color: var(--text-light); }
.file-downloads { font-weight: 600; color: var(--accent); }

.file-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.file-category-tag {
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 11px;
  font-weight: 500;
}

.file-download-btn {
  padding: 8px 18px !important;
  font-size: 13px !important;
  text-decoration: none;
}

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Form Messages ---- */
.form-msg {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 16px;
}
.msg-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.msg-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .file-grid { grid-template-columns: 1fr; }
  .file-card-header { padding: 14px 16px; }
  .file-card-body { padding: 12px 16px; }
}
