* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  background: #1a1a1a;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.hidden {
  display: none !important;
}

/* login screen */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#login-form {
  width: 100%;
  max-width: 320px;
  background: #fff;
  padding: 40px 32px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login-form h1 {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

#login-form input {
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

#login-form button {
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}

.error {
  color: #c0392b;
  font-size: 13px;
  text-align: center;
}

/* admin shell */
#admin-app {
  max-width: 1240px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  padding: 48px;
}

#admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

#admin-header h1 {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

#admin-header nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

#admin-header nav a {
  color: #000;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#admin-header nav a:hover {
  text-decoration: underline;
}

#logout-btn {
  border: none;
  background: none;
  color: #999;
  font-family: inherit;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

#logout-btn:hover {
  color: #000;
}

/* about section */
#about-section {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}

#about-saved {
  color: #2e7d32;
  font-size: 13px;
}

/* upload section */
#about-section h2,
#upload-section h2,
#library-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-hint {
  color: #777;
  font-size: 14px;
  margin-bottom: 24px;
}

.dropzone-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dropzone {
  display: block;
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 48px 24px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #000;
  background: #fafafa;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f2f2;
  border-radius: 10px;
  font-size: 18px;
}

.dropzone-hint {
  color: #999;
  font-size: 13px;
}

.dropzone-preview {
  width: 100%;
  max-width: 240px;
  max-height: 160px;
  border-radius: 8px;
  object-fit: cover;
}

.publish-row {
  display: flex;
  gap: 16px;
}

#post-title {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

#publish-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
}

#publish-btn:disabled {
  background: #bbb;
  cursor: not-allowed;
}

/* library */
#library-section {
  margin-top: 56px;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.library-header h2 {
  margin-bottom: 0;
}

#search-input {
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  width: 240px;
}

#library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.post-card {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

.post-card-media {
  display: flex;
  height: 160px;
}

.post-card-media video,
.post-card-media img {
  width: 50%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: 16px;
}

.post-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.post-card-date {
  color: #999;
  font-size: 13px;
  margin-bottom: 12px;
}

.post-card-actions {
  display: flex;
  gap: 8px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.pill-btn:hover {
  background: #f5f5f5;
}

#library-empty {
  color: #999;
  font-size: 14px;
  padding: 40px 0;
  text-align: center;
}

/* edit modal */
#edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

#edit-modal {
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  background: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.edit-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.edit-modal-header button {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #999;
}

#edit-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.edit-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-field-row label {
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.edit-field-row input,
.edit-field-row textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.replace-video-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.replace-video-current {
  font-size: 13px;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.replace-video-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  background: #fafafa;
}

.replace-video-btn:hover {
  background: #f0f0f0;
}

.edit-side {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-side-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
}

.edit-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #eee;
}

.edit-modal-footer .error {
  margin-right: auto;
  text-align: left;
}

.btn-secondary,
.btn-primary {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  border: 1px solid #ddd;
  background: #fff;
}

.btn-primary {
  border: none;
  background: #000;
  color: #fff;
}
