/* ==========================================================================
   IKY CADIAK BLOG - ULTRA CLEAN DESIGN SYSTEM
   - 2 Admin Mode Navigation Tabs (Halaman Otomatis vs Halaman Manual)
   - Rich Text Formatting Toolbar & Paragraph Support
   - Move2link REST API Auto-Shortener Integration
   - YouTube 2-Link Workflow Preset (Tanpa PW vs Pake PW)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --bg-color: #f4f4f4;
  --card-bg: #ffffff;
  --text-color: #424242;
  --text-muted: #757575;
  --link-color: #2196f3;
  --link-hover: #1976d2;
  --border-color: #e0e0e0;
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 24px 0 60px 0;
}

/* Page Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Back Arrow Button */
.back-bar {
  margin-bottom: 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #212121;
  text-decoration: none;
  font-size: 24px;
  transition: background 0.2s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}

.back-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

/* SVG Vector Icons Styling */
.svg-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}

/* Mode Navigation Bar (2 Main Admin Pages: Auto vs Manual) */
.mode-navigation-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.mode-nav-item {
  flex: 1;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  background-color: #ffffff;
  color: var(--text-muted);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mode-nav-item:hover {
  background-color: #f9f9f9;
  border-color: #bdbdbd;
  color: #212121;
}

.mode-nav-item.active {
  background-color: var(--link-color);
  color: #ffffff;
  border-color: var(--link-color);
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.mode-nav-item.active .svg-icon {
  fill: #ffffff;
}

/* Post Cards */
.post-card {
  background-color: var(--card-bg);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  padding: 24px 28px;
  margin-bottom: 20px;
  position: relative;
}

.post-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.post-date {
  font-size: 14px;
  color: var(--text-muted);
}

.post-title {
  font-size: 20px;
  font-weight: 700;
  color: #212121;
  margin-bottom: 14px;
  line-height: 1.4;
}

.post-title a {
  color: #212121;
  text-decoration: none;
}

.post-title a:hover {
  color: var(--link-color);
}

/* Rich Content & Paragraph Formatting */
.post-content {
  font-size: 15px;
  color: var(--text-color);
  line-height: 1.7;
  word-break: break-word;
}

.post-content p {
  margin-bottom: 16px;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-content b, .post-content strong {
  font-weight: 700;
  color: #111;
}

.post-content i, .post-content em {
  font-style: italic;
}

.post-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 18px 0 10px 0;
  color: #212121;
}

.post-content a, .content-link {
  color: var(--link-color);
  text-decoration: none;
  word-break: break-all;
}

.post-content a:hover, .content-link:hover {
  text-decoration: underline;
}

.post-bottom-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.read-more-btn {
  color: var(--link-color);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  text-decoration: none;
  text-transform: uppercase;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.read-more-btn:hover {
  background-color: rgba(33, 150, 243, 0.08);
}

.post-dashed-divider {
  border: none;
  border-bottom: 1px dashed #bdbdbd;
  margin-top: 28px;
  margin-bottom: 8px;
}

/* Pagination Control */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--link-color);
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.page-btn:hover:not(.disabled):not(.active) {
  background-color: #f5f5f5;
  border-color: #bdbdbd;
}

.page-btn.active {
  background-color: var(--link-color);
  color: #ffffff;
  border-color: var(--link-color);
  font-weight: 700;
  cursor: default;
}

.page-btn.disabled {
  color: #bdbdbd;
  border-color: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Admin Panel Layout & Split View */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.admin-title {
  font-size: 22px;
  font-weight: 700;
  color: #212121;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-card {
  background-color: var(--card-bg);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

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

.preview-container {
  position: sticky;
  top: 24px;
}

.preview-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Switch Component */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fafafa;
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.switch-label {
  font-weight: 500;
  font-size: 14px;
  color: #212121;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

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

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

/* Rich Text Toolbar & Formatting Options */
.formatting-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  align-items: center;
  background: #f5f5f5;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.fmt-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  color: #333;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fmt-btn:hover {
  background: #e3f2fd;
  border-color: var(--link-color);
  color: var(--link-color);
}

.btn-m2l {
  background: #2e7d32;
  color: #ffffff;
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-m2l:hover {
  background: #1b5e20;
}

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

.form-label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  outline: none;
}

.form-textarea-editor {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--link-color);
}

.form-textarea {
  min-height: 200px;
  resize: vertical;
}

.btn-blue {
  background-color: var(--link-color);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-blue:hover {
  background-color: var(--link-hover);
}

.btn-danger {
  background-color: #e53935;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-danger:hover {
  background-color: #c62828;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.admin-table th, .admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.admin-nav-btn {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-nav-btn:hover {
  background: #f5f5f5;
  color: #212121;
}

/* Custom Modal Confirmation Box */
.custom-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-modal {
  background: #ffffff;
  border-radius: 6px;
  padding: 24px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #212121;
}

.custom-modal-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.custom-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #323232;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: none;
}
