/* =====================================================
   HomiPaw – Admin Panel CSS
   Bảng điều khiển tùy chỉnh giao diện (không cần code)
   ===================================================== */

/* ----- Nút mở panel ----- */
.admin-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #D9825B, #B96848);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(217, 130, 91, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: admin-pulse 2s ease-in-out infinite;
}

.admin-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(217, 130, 91, 0.5);
}

.admin-toggle.active {
  animation: none;
  background: linear-gradient(135deg, #B96848, #943E28);
}

@keyframes admin-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(217, 130, 91, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(217, 130, 91, 0.6); }
}

/* ----- Overlay ----- */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(36, 33, 31, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
}

.admin-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ----- Panel chính ----- */
.admin-panel {
  position: fixed;
  top: 0;
  left: -480px;
  z-index: 99999;
  width: 460px;
  max-width: 92vw;
  height: 100vh;
  background: #FAFAF7;
  box-shadow: 8px 0 40px rgba(36, 33, 31, 0.15);
  transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-panel.open {
  left: 0;
}

/* ----- Header panel ----- */
.admin-panel__header {
  padding: 20px 24px;
  background: linear-gradient(135deg, #3B3530, #2C2825);
  color: #F5F0E8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.admin-panel__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-panel__header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(217, 130, 91, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.admin-panel__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.admin-panel__subtitle {
  font-size: 11px;
  color: #B8B0A5;
  margin-top: 2px;
}

.admin-panel__close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: #F5F0E8;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-panel__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ----- Tabs ----- */
.admin-tabs {
  display: flex;
  background: #F0EDE6;
  border-bottom: 1px solid #E5DED4;
  overflow-x: auto;
  flex-shrink: 0;
}

.admin-tabs::-webkit-scrollbar {
  height: 0;
}

.admin-tab {
  flex: 1;
  min-width: fit-content;
  padding: 12px 16px;
  border: none;
  background: none;
  color: #706B65;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-tab:hover {
  color: #24211F;
  background: rgba(217, 130, 91, 0.05);
}

.admin-tab.active {
  color: #D9825B;
  background: #FAFAF7;
}

.admin-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #D9825B;
}

.admin-tab__icon {
  font-size: 14px;
}

/* ----- Nội dung cuộn ----- */
.admin-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.admin-panel__body::-webkit-scrollbar {
  width: 5px;
}

.admin-panel__body::-webkit-scrollbar-thumb {
  background: #D4CCC0;
  border-radius: 4px;
}

/* Tab content */
.admin-tab-content {
  display: none;
  padding: 20px 24px;
}

.admin-tab-content.active {
  display: block;
}

/* ----- Nhóm điều khiển ----- */
.admin-group {
  margin-bottom: 24px;
}

.admin-group__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #24211F;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #E5DED4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-group__title-icon {
  font-size: 14px;
}

/* ----- Color picker row ----- */
.admin-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #E5DED4;
  transition: all 0.2s;
}

.admin-color-row:hover {
  border-color: #D9825B;
  box-shadow: 0 2px 8px rgba(217, 130, 91, 0.1);
}

.admin-color-row label {
  flex: 1;
  font-size: 13px;
  color: #3B3530;
  font-weight: 500;
}

.admin-color-row input[type="color"] {
  width: 40px;
  height: 32px;
  border: 2px solid #E5DED4;
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: #fff;
  transition: border-color 0.2s;
}

.admin-color-row input[type="color"]:hover {
  border-color: #D9825B;
}

.admin-color-row .admin-color-hex {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #E5DED4;
  border-radius: 6px;
  font-family: 'Inter', monospace;
  font-size: 12px;
  color: #3B3530;
  text-align: center;
  background: #F5F0E8;
}

/* ----- Text input row ----- */
.admin-text-row {
  margin-bottom: 14px;
}

.admin-text-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3B3530;
  margin-bottom: 6px;
}

.admin-text-row input,
.admin-text-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E5DED4;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #24211F;
  background: #fff;
  transition: all 0.2s;
  resize: vertical;
}

.admin-text-row input:focus,
.admin-text-row textarea:focus {
  outline: none;
  border-color: #D9825B;
  box-shadow: 0 0 0 3px rgba(217, 130, 91, 0.12);
}

.admin-text-row textarea {
  min-height: 70px;
}

/* ----- Select row ----- */
.admin-select-row {
  margin-bottom: 14px;
}

.admin-select-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #3B3530;
  margin-bottom: 6px;
}

.admin-select-row select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E5DED4;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #24211F;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23706B65' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.admin-select-row select:focus {
  outline: none;
  border-color: #D9825B;
  box-shadow: 0 0 0 3px rgba(217, 130, 91, 0.12);
}

/* ----- Range slider ----- */
.admin-range-row {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #E5DED4;
}

.admin-range-row label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: #3B3530;
  margin-bottom: 8px;
}

.admin-range-row label span {
  color: #D9825B;
  font-weight: 600;
  font-size: 12px;
  background: rgba(217, 130, 91, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.admin-range-row input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #E5DED4;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.admin-range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #D9825B;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(217, 130, 91, 0.3);
  transition: all 0.2s;
}

.admin-range-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* ----- Footer actions ----- */
.admin-panel__footer {
  padding: 16px 24px;
  background: #F0EDE6;
  border-top: 1px solid #E5DED4;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.admin-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.admin-btn--save {
  background: linear-gradient(135deg, #D9825B, #B96848);
  color: #fff;
  box-shadow: 0 3px 12px rgba(217, 130, 91, 0.3);
}

.admin-btn--save:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(217, 130, 91, 0.4);
}

.admin-btn--reset {
  background: #fff;
  color: #706B65;
  border: 1px solid #D4CCC0;
}

.admin-btn--reset:hover {
  color: #c0392b;
  border-color: #c0392b;
  background: #fff5f5;
}

.admin-btn--export {
  background: #fff;
  color: #3B3530;
  border: 1px solid #D4CCC0;
}

.admin-btn--export:hover {
  border-color: #A8B8A0;
  color: #5a7a50;
  background: #f5faf3;
}

/* ----- Toast notification ----- */
.admin-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 28px;
  background: #3B3530;
  color: #F5F0E8;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(36, 33, 31, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.admin-toast__icon {
  font-size: 16px;
}

/* ----- Preview badge ----- */
.admin-preview-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 99997;
  padding: 8px 16px;
  background: linear-gradient(135deg, #D9825B, #B96848);
  color: #fff;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(217, 130, 91, 0.3);
  display: none;
  align-items: center;
  gap: 6px;
  animation: admin-badge-pulse 1.5s ease-in-out infinite;
}

.admin-preview-badge.show {
  display: flex;
}

@keyframes admin-badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ----- Responsive ----- */
@media (max-width: 500px) {
  .admin-panel {
    width: 100vw;
    left: -100vw;
  }
  
  .admin-toggle {
    bottom: 16px;
    left: 16px;
    width: 46px;
    height: 46px;
    font-size: 20px;
  }
  
  .admin-tabs {
    gap: 0;
  }
  
  .admin-tab {
    padding: 10px 12px;
    font-size: 11px;
  }
  
  .admin-panel__footer {
    flex-wrap: wrap;
  }
  
  .admin-btn--export {
    flex-basis: 100%;
  }
}

/* ----- Dark theme cho panel nếu cần ----- */
.admin-panel .admin-info {
  padding: 10px 14px;
  background: rgba(168, 184, 160, 0.12);
  border-radius: 8px;
  border-left: 3px solid #A8B8A0;
  font-size: 12px;
  color: #706B65;
  line-height: 1.6;
  margin-bottom: 16px;
}

.admin-panel .admin-info strong {
  color: #3B3530;
}

/* ----- Import/Export modal ----- */
.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(36, 33, 31, 0.5);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}

.admin-modal.show {
  display: flex;
}

.admin-modal__box {
  background: #FAFAF7;
  border-radius: 16px;
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(36, 33, 31, 0.2);
}

.admin-modal__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #24211F;
  margin-bottom: 12px;
}

.admin-modal textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid #E5DED4;
  border-radius: 10px;
  font-family: 'Inter', monospace;
  font-size: 11px;
  color: #3B3530;
  resize: vertical;
  margin-bottom: 14px;
}

.admin-modal textarea:focus {
  outline: none;
  border-color: #D9825B;
}

.admin-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.admin-modal__btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-modal__btn--primary {
  background: #D9825B;
  color: #fff;
}

.admin-modal__btn--primary:hover {
  background: #B96848;
}

.admin-modal__btn--secondary {
  background: #E5DED4;
  color: #3B3530;
}

.admin-modal__btn--secondary:hover {
  background: #D4CCC0;
}

/* ----- Section divider in panel ----- */
.admin-divider {
  height: 1px;
  background: #E5DED4;
  margin: 20px 0;
}
