/* ==========================================================================
   BATIK VR - ADMIN PANEL STYLESHEET
   Luxury Cultural Dark & Gold Modern Theme
   ========================================================================== */

:root {
  --bg-main: #120A06;
  --bg-sidebar: #1A0E09;
  --bg-card: rgba(36, 21, 14, 0.7);
  --bg-card-hover: rgba(48, 28, 19, 0.85);
  --border-card: rgba(176, 141, 87, 0.25);
  --border-focus: #D4AF37;
  
  --gold-primary: #B08D57;
  --gold-light: #D4AF37;
  --gold-bright: #F5D77F;
  --gold-glow: rgba(212, 175, 55, 0.25);

  --text-main: #FFFDF8;
  --text-muted: #B8ADA0;
  --text-dim: #7D7368;
  --text-accent: #E5C384;

  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.15);
  
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* ==================== LAYOUT ==================== */
.admin-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.admin-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon-box {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--gold-primary), #8D6E63);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(176, 141, 87, 0.3);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.brand-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(176, 141, 87, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(176, 141, 87, 0.3);
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1;
}

.nav-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 0.5rem 0.75rem 0.35rem;
  font-weight: 700;
}

.nav-items {
  list-style: none;
  margin-bottom: 1rem;
}

.nav-tab-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: var(--transition);
}

.nav-tab-btn:hover {
  background: rgba(176, 141, 87, 0.1);
  color: var(--text-main);
}

.nav-tab-btn.active {
  background: linear-gradient(90deg, rgba(176, 141, 87, 0.25) 0%, rgba(176, 141, 87, 0.08) 100%);
  color: var(--gold-bright);
  font-weight: 600;
  border-left: 3px solid var(--gold-light);
}

.nav-tab-btn.active svg {
  opacity: 1;
  color: var(--gold-light);
}

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border-card);
  background: rgba(0, 0, 0, 0.2);
}

.admin-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3E2723;
  border: 1px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.9rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-logout:hover {
  background: var(--danger);
  color: #fff;
}

/* ==================== MAIN CONTENT ==================== */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

/* Header */
.admin-header {
  padding: 1.25rem 2rem;
  background: rgba(26, 14, 9, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.header-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.header-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary) 0%, #8D6E63 100%);
  color: #FFFDF8;
  box-shadow: 0 4px 14px rgba(176, 141, 87, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(176, 141, 87, 0.45);
  background: linear-gradient(135deg, #C5A059 0%, #9C7D72 100%);
}

.btn-secondary {
  background: rgba(255, 253, 248, 0.07);
  border: 1px solid var(--border-card);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 253, 248, 0.14);
  border-color: var(--gold-light);
  color: var(--gold-bright);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* ==================== CONTENT BODY ==================== */
.admin-body {
  padding: 2rem;
  flex: 1;
  max-width: 1200px;
  width: 100%;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.admin-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 14, 9, 0.4);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(176, 141, 87, 0.15);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-body {
  padding: 1.75rem 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-card);
  background: rgba(18, 10, 6, 0.5);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==================== FORMS ==================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 0.45rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(18, 10, 6, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: rgba(18, 10, 6, 0.95);
}

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

/* File Upload Box */
.file-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.current-media-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-card);
}

.preview-thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-card);
  background: #1e120b;
}

.preview-meta {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.preview-meta strong {
  display: block;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.file-input-btn-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Custom Dynamic Motif Items */
.motif-admin-card {
  background: rgba(26, 14, 9, 0.6);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  transition: var(--transition);
}

.motif-admin-card:hover {
  border-color: rgba(176, 141, 87, 0.45);
}

.motif-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-card);
}

.motif-num-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(176, 141, 87, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ==================== INSTALLER UPLOADER STYLES ==================== */
.installer-meta-card {
  background: rgba(18, 10, 6, 0.7);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.installer-file-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.file-status-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.file-type-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(176, 141, 87, 0.3), rgba(26, 14, 9, 0.9));
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  flex-shrink: 0;
}

.file-meta-details strong {
  display: block;
  color: var(--text-main);
  font-size: 0.95rem;
  word-break: break-all;
}

.file-meta-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}

.badge-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.empty {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.installer-dropzone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  background: rgba(18, 10, 6, 0.5);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: block;
}

.dropzone-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.installer-dropzone:hover,
.installer-dropzone:focus-within,
.installer-dropzone.dragover {
  border-color: var(--gold-light);
  background: rgba(48, 28, 19, 0.6);
  box-shadow: 0 0 20px var(--gold-glow);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  color: var(--gold-light);
  opacity: 0.9;
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Upload Progress Box */
.installer-progress-card {
  display: none;
  background: rgba(26, 14, 9, 0.9);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.installer-progress-card.active {
  display: block;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.progress-filename {
  font-weight: 600;
  color: var(--gold-bright);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-rate {
  color: var(--text-muted);
  font-family: monospace;
}

.progress-track {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-card);
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #B08D57, #D4AF37, #F5D77F);
  border-radius: 99px;
  transition: width 0.2s ease-out;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-status-msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  min-width: 300px;
  max-width: 400px;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  background: rgba(16, 185, 129, 0.9);
  border: 1px solid #10B981;
}

.toast-error {
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid #EF4444;
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
  .admin-sidebar {
    position: fixed;
    left: -290px;
    transition: var(--transition);
  }
  .admin-sidebar.open {
    left: 0;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .admin-body {
    padding: 1.25rem;
  }
}

@media (max-width: 600px) {
  .admin-header {
    padding: 1rem;
  }
  .header-actions .btn span {
    display: none;
  }
}
