/* ========== RESET & BODY ========== */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f9f9f9;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

/* ========== HEADER & LOGO ========== */
header {
  background: #cce4ff;
  padding: 20px 0;
  margin-bottom: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo-link {
  color: #003366;
  text-decoration: none;
  font-size: 26px;
  font-weight: bold;
}
.logo-link:hover {
  text-decoration: underline;
}

/* ========== LOGIN FORM ========== */
.login-form {
  display: flex;
  gap: 8px;
}
header input,
header button {
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid #999;
  font-size: 14px;
}

/* ========== MAIN MENU NAVIGASI ========== */
.main-menu {
  background: #f8f9fc;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}
.menu-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  padding: 15px 0;
}
.menu-container a {
  color: #0369a1;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
}
.menu-container a:hover {
  text-decoration: underline;
}

/* ========== SPLIT NAV DASHBOARD / ADMIN ========== */
.nav-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.nav-left a,
.nav-right a {
  margin: 0 10px;
  text-decoration: none;
  font-weight: bold;
}
.nav-left a { color: #034078; }
.nav-right a { color: #333; }
.nav-right a.nav-highlight { color: #1d4ed8; }
.nav-right a.nav-admin { color: #be123c; }

/* ========== NAV LINK BUTTONS ========== */
.nav-link {
  background: transparent;
  color: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 20px;
  padding: 6px 12px;
  margin-left: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}
.nav-link:hover {
  background: #ffff;
  color: white;
}
.logout-link {
  color: red !important;
  margin-left: 12px;
  text-decoration: none;
  font-weight: 500;
}
.logout-link:hover {
  text-decoration: underline;
}

/* ========== CARD BLOCKS ========== */
.card {
  background: #ffffff;
  padding: 20px;
  margin: 25px 0;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.06);
}
.card ul {
  padding-left: 18px;
}
.card li {
  margin-bottom: 8px;
}
.card form input,
.card form textarea,
.card form select {
  margin-bottom: 8px;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* ========== FORM ELEMENTS ========== */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #aaa;
  border-radius: 5px;
  font-size: 14px;
}
button {
  padding: 10px 15px;
  background: #034078;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}
button:hover {
  background: #022e5a;
}

/* ========== GLOBAL IMAGE STYLE ========== */
img {
  border-radius: 6px;
  margin-bottom: 10px;
  max-width: 100%;
}

/* ========== FOOTER ========== */
footer {
  background: #eeeeee;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  font-size: 14px;
  color: #555555;
  border-top: 1px solid #ddd;
}

/* ========== RESPONSIVE NAV & MENU ========== */
@media screen and (max-width: 600px) {
  .header-top {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .login-form {
    flex-direction: column;
    width: 100%;
  }
  .nav-split {
    flex-direction: column;
    gap: 10px;
  }
  .nav-left,
  .nav-right,
  .menu-container {
    text-align: center;
    width: 100%;
    justify-content: center;
  }
}

/* ========== TABEL DAFTAR USER / DOMAIN ========== */
.user-table,
.domain-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}
.user-table th,
.user-table td,
.domain-table th,
.domain-table td {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 14px;
}
.user-table th,
.domain-table th {
  background: #f3f4f6;
  font-weight: bold;
  color: #333;
}
.user-table tr:nth-child(even) {
  background: #fafafa;
}
tr.changed-row {
  background-color: #e0f7fa;
  transition: background 0.3s ease;
}
.editable-field {
  width: 100px;
  padding: 6px;
  border: 1px solid #ccc;
  text-align: right;
}

/* ========== BUTTONS (EDIT, DELETE, BULK, ROLE) ========== */
.edit-button {
  display: inline-block;
  padding: 8px 14px;
  background: #0284c7;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  text-decoration: none;
  font-size: 14px;
}
.edit-button:hover {
  background: #026aa7;
}
.role-button,
.delete-button {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 4px;
  margin-left: 5px;
  text-decoration: none;
  color: #fff;
}
.role-button {
  background: orange;
}
.role-button:hover {
  background: darkorange;
}
.delete-button {
  background: crimson;
}
.delete-button:hover {
  background: darkred;
}
.save-row-btn,
.delete-row-btn,
#saveBulkBtn,
#deleteBulkBtn {
  padding: 6px 12px;
  margin: 2px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  font-weight: bold;
}
.save-row-btn {
  background-color: #3498db;
  color: white;
}
.delete-row-btn,
#deleteBulkBtn {
  background-color: #e74c3c;
  color: white;
}
#saveBulkBtn {
  background-color: #2ecc71;
  color: white;
}
.btn-order-small {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  background-color: #1d4ed8;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s;
}
.btn-order-small:hover {
  background-color: #2563eb;
}

/* ========== STATUS AKTIF / NONAKTIF ========== */
span.aktif {
  color: green;
  font-weight: bold;
}
span.nonaktif {
  color: #888;
  font-style: italic;
}

/* ========== DOMAIN TOOLS: CHECKBOX, ROW INTERACTION ========== */
#selectAll {
  cursor: pointer;
}
.row-check {
  transform: scale(1.2);
}

/* ========== SUGGESTION BOX ========== */
#suggestion-box {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
}
#suggestion-box div:hover {
  background: #f0f4f8;
  cursor: pointer;
}

/* ========== TOAST NOTIFICATIONS ========== */
#toastArea {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}
.floating-alert {
  background-color: #2ecc71;
  color: white;
  padding: 10px 18px;
  margin-bottom: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: fadeIn 0.3s ease;
}
.floating-alert.error {
  background-color: #e74c3c;
}

/* ========== PROMO & ALT CARD GRID ========== */
.promo-grid,
.alt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
}
.alt-suggestion {
  margin-top: 20px;
}

/* ========== PROMO & ALT CARD STYLE ========== */
.promo-card,
.alt-card {
  background: #f3f3f3;
  border: 1px solid #ddd;
  padding: 16px;
  border-radius: 10px;
  width: 180px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  position: relative;
}
.promo-card:hover,
.alt-card:hover {
  transform: scale(1.05);
  background: #eaf4ff;
}
.promo-card p,
.alt-card p {
  margin: 4px 0;
}
.promo-card strong,
.harga-promo {
  font-weight: bold;
  font-size: 16px;
  color: #2c7be5;
}
.promo-card s,
.harga-asli s {
  color: #999;
}
.harga-asli {
  text-decoration: line-through;
  color: #888;
}
.diskon-label {
  background: #ffcc00;
  color: #333;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
  font-weight: bold;
}
.label-popular {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff5722;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: bold;
}
.promo-section .promo-grid,
.promo-section .promo-card,
.promo-section .label-popular,
.promo-section .harga-asli,
.promo-section .diskon-label,
.promo-section .harga-promo {
  all: unset;
  /* inherit all above styles */
}

/* ========== BLOG POST LAYOUT ========== */
.post-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-item {
  display: flex;
  align-items: center;
  gap: 15px;
}
.featured-img,
.featured-video {
  width: 215px;
  height: 161px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.post-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 161px;
  flex: 1;
}
.post-text a {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 6px;
  color: #222;
  text-decoration: none;
}
.post-text span {
  color: #777;
  font-size: 0.9em;
}

/* ========== POST TABLES ========== */
.post-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.post-table th,
.post-table td {
  border-bottom: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}
.post-table th {
  background-color: #f7f7f7;
}
.post-table tr:hover {
  background-color: #f0f0f0;
}
.action-buttons {
  display: none;
  font-size: 14px;
}
.post-table tr:hover .action-buttons {
  display: inline-block;
}
.page-header .btn {
  background-color: #2c7be5;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
}
.page-header .btn:hover {
  background-color: #1a68d3;
}

/* ========== FORM GRID ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.form-grid label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

/* ========== ANIMASI ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.domain-status {
  animation: fadeIn 0.4s ease;
}

/* ========== RESPONSIVE MOBILE OPTIMIZATION ========== */
@media screen and (max-width: 600px) {
  .promo-card,
  .alt-card {
    width: 100%;
    max-width: 300px;
  }
  .featured-img {
    width: 40vw;
    height: auto;
  }
  .featured-video {
    width: 100px;
    height: 75px;
  }
  .post-item {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: nowrap;
  }
  .post-text {
    height: auto;
    font-size: 0.9em;
  }
  .post-text a {
    font-size: 1em;
  }
  .post-text span {
    font-size: 0.85em;
  }
  input[type="text"] {
    width: 100% !important;
  }
}

/*===================HALAMAN DASHBOARD=====================*/

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 25px;
}

.dashboard-box {
  flex: 1;
  min-width: 240px;
  padding: 15px 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dashboard-box .icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.subnote {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
  display: block;
}

.status-label {
  font-weight: bold;
}

.status-label.active { color: green; }
.status-label.suspended { color: red; }
.status-label.inactive { color: #666; }

.edit-button.small {
  font-size: 13px;
  padding: 6px 10px;
  text-decoration: none;
  background: #f0f0f0;
  color: #222;
  border-radius: 4px;
}

.edit-button.small:hover {
  background: #e0e0e0;
}

.edit-button.bordered {
  background: transparent;
  border: 1px solid #333;
}

.subscription-action {
  margin-top: 10px;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.user-table th, .user-table td {
  padding: 8px 10px;
  border: 1px solid #ccc;
  font-size: 13px;
  text-align: left;
}

.user-table th {
  background: #efefef;
  font-weight: 600;
}


@media screen and (max-width: 768px) {
  .card-row .dashboard-box {
    flex: 1 0 48%;
  }
}

/*====================HALAMAN CLOUDSTORAGE=======================*/
.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}
.file-table th, .file-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}
.file-table th {
  background: #f5f5f5;
  font-weight: 500;
}
.file-table td.actions a {
  margin-right: 8px;
  text-decoration: none;
  color: #333;
}

.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.3); display: none;
  justify-content: center; align-items: center;
  z-index: 999;
}
.modal-box {
  background: #fff; padding: 20px; border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  text-align: center; width: 300px;
}
.modal-box input[type="text"] {
  width: 100%; padding: 8px; margin: 10px 0;
}
.modal-buttons button {
  padding: 6px 12px; margin: 0 8px; border: none;
  background: #4285f4; color: white; border-radius: 4px;
  cursor: pointer;
}
.modal-buttons button:first-child {
  background: #ccc; color: #333;
}

.flash-msg {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 320px;
  background: #f2f2f2;
  color: #333;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  z-index: 9999;
  animation: fadeInDown 0.3s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/*==========TOMBOL TAMBAH UPLOAD FILE=============*/
.new-button-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  position: relative;
}
.new-button-top .new-menu {
  position: absolute;
  top: 45px;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}
.new-button-top .new-menu a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
}
.new-button-top .new-menu a:hover {
  background: #f5f5f5;
}