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

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #333;
}

/* ===== ADMIN LAYOUT ===== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  width: 240px;
  background: #111;
  color: #fff;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.admin-logo {
  text-align: center;
  margin-bottom: 30px;
  font-size: 20px;
}

.admin-sidebar nav a {
  display: block;
  color: #fff;
  padding: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  border-radius: 4px;
}

.admin-sidebar nav a:hover {
  background: #333;
}

.logout-btn {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* MAIN CONTENT */
.admin-content {
  flex: 1;
  padding: 30px;
}

/* DASHBOARD CARDS */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.dash-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.dash-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.dash-card p {
  font-size: 28px;
  font-weight: bold;
}

/* TABLE */
.admin-table {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
  margin-top: 20px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

/* BADGES */
.badge-green {
  background: #27ae60;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
}

.badge-gray {
  background: #7f8c8d;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
}

/* BUTTONS */
.btn-primary {
  background: #111;
  color: #fff;
  padding: 10px 15px;
  border-radius: 4px;
  text-decoration: none;
}

/* FORMS */
.form-box {
  background: #fff;
  padding: 20px;
  max-width: 800px;
  border-radius: 6px;
}

.form-box label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

.form-box input,
.form-box select,
.form-box textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
}

.check-row {
  margin-top: 15px;
  display: flex;
  gap: 20px;
}

.inline {
  display: inline;
}

.link-danger {
  background: none;
  color: red;
  border: none;
  cursor: pointer;
}

/* ===== FRONTEND (SAFE TO KEEP) ===== */
.site-header {
  background: #111;
  color: #fff;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.news-card {
  background: #fff;
  padding: 10px;
  border-radius: 6px;
}

.footer {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 15px;
}

/* ===== CATEGORIES PAGE ===== */
.category-wrapper {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 30px;
  margin-top: 20px;
}

.category-form,
.category-list {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
}

.category-form h3,
.category-list h3 {
  margin-bottom: 15px;
}

.category-form input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .category-wrapper {
    grid-template-columns: 1fr;
  }
}

/* ===== CATEGORY EDIT ===== */
.inline-edit {
  display: flex;
  gap: 8px;
}

.inline-edit input {
  padding: 6px;
  width: 180px;
}

.btn-small {
  padding: 6px 10px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* ===== ARTICLE EDITOR ===== */
.editor-toolbar {
  background: #eee;
  padding: 8px;
  margin-bottom: 5px;
  border-radius: 4px;
}

.editor-toolbar button {
  padding: 5px 8px;
  margin-right: 5px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

.editor-toolbar button:hover {
  background: #ddd;
}

textarea#editor {
  width: 100%;
  font-size: 15px;
  line-height: 1.6;
}

/* ACTION ROW */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-secondary {
  background: #555;
  color: #fff;
  padding: 10px 15px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

/* PREVIEW MODAL */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.preview-content {
  background: #fff;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border-radius: 6px;
  position: relative;
}

.close-preview {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
}
/* ===== SETTINGS PAGE ===== */

.settings-form {
  max-width: 900px;
}

.settings-card {
  background: #fff;
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 6px;
}

.settings-card h3 {
  margin-bottom: 15px;
  font-size: 18px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

.settings-card label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

.settings-card input,
.settings-card textarea,
.settings-card select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.settings-card textarea {
  resize: vertical;
}

.settings-form .btn-primary {
  margin-top: 20px;
}
.menu-sortable li {
  background: #f9f9f9;
  padding: 8px;
  margin-bottom: 5px;
  cursor: move;
  display: flex;
  justify-content: space-between;
}

.drag-handle {
  margin-right: 10px;
  cursor: grab;
}
/* ===================================================
   FRONTEND HOMEPAGE UI
   (Admin-Driven, Clean News Layout)
=================================================== */

/* SECTION TITLES */
.section-title {
  font-size: 20px;
  margin: 25px 0 15px;
  border-left: 4px solid #111;
  padding-left: 10px;
}

/* ===== HERO / FEATURED ===== */
.hero {
  margin: 25px 0;
}

.hero-card {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
}

.hero-card img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 25px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
}

.hero-overlay h1 {
  color: #fff;
  font-size: 28px;
  line-height: 1.3;
}

/* ===== HOMEPAGE GRID ===== */
.home-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 30px;
  margin-top: 30px;
}

/* ===== LATEST NEWS ROWS ===== */
.news-row {
  display: flex;
  gap: 15px;
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.news-row img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
}

.news-row h3 {
  font-size: 16px;
  margin: 0;
}

/* ===== CATEGORY BLOCKS ===== */
.category-section {
  margin-top: 40px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

.category-card {
  background: #fff;
  padding: 14px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.category-card h4 {
  font-size: 15px;
  line-height: 1.4;
}

/* ===== SIDEBAR ===== */
.home-sidebar {
  background: #fff;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.sidebar-box {
  margin-bottom: 25px;
}

.sidebar-box h3 {
  font-size: 16px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

/* ===== AD BOX ===== */
.ad-box img {
  width: 100%;
  border-radius: 6px;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: 40px;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .news-row {
    flex-direction: column;
  }

  .news-row img {
    width: 100%;
    height: auto;
  }

  .hero-card img {
    height: 280px;
  }
}
/* ===== TOP BAR ===== */
.top-bar {
  background: #000;
  color: #fff;
  font-size: 13px;
}

.top-bar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.top-left span {
  margin-right: 15px;
}

.top-right a {
  color: #fff;
  margin-left: 15px;
  text-decoration: none;
  font-weight: bold;
}

.top-right a:hover {
  text-decoration: underline;
}
/* ===== BREAKING NEWS TICKER ===== */
.breaking-bar {
  display: flex;
  align-items: center;
  background: #c0392b;
  color: #fff;
  padding: 6px 0;
  overflow: hidden;
}

.breaking-label {
  background: #900;
  padding: 6px 12px;
  font-weight: bold;
  text-transform: uppercase;
  margin-right: 10px;
}

.breaking-track {
  overflow: hidden;
  white-space: nowrap;
  flex: 1;
}

.breaking-content {
  display: inline-block;
  animation: ticker 25s linear infinite;
}

.breaking-content a {
  color: #fff;
  margin-right: 40px;
  text-decoration: none;
  font-weight: 500;
}

@keyframes ticker {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}
.breaking-bar:hover .breaking-content {
  animation-play-state: paused;
}
