/* ===== Admin Panel Styles ===== */
:root {
  --primary: #6C63FF;
  --primary-light: rgba(108,99,255,0.15);
  --bg: #0f0e17;
  --sidebar-bg: #13121f;
  --card-bg: #1a1a2e;
  --border: rgba(255,255,255,0.08);
  --text: #fffffe;
  --text-muted: #a8a8b3;
  --success: #43D9AD;
  --danger: #FF6584;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Poppins', sans-serif;
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
input, textarea, select, button { font-family: var(--font); }

/* ===== Login Screen ===== */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 50%, rgba(108,99,255,0.2) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(255,101,132,0.1) 0%, transparent 50%),
              var(--bg);
}
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.login-logo {
  font-size: 2rem; font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 8px;
}
.login-logo span { color: var(--primary); }
.login-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }
.input-wrap {
  position: relative; margin-bottom: 16px;
}
.input-wrap i {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.9rem;
}
.input-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px 14px 44px;
  color: var(--text); font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.input-wrap input:focus { border-color: var(--primary); }
.login-error {
  background: rgba(255,101,132,0.1);
  border: 1px solid rgba(255,101,132,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--danger);
  font-size: 0.85rem; margin-bottom: 16px;
}
.login-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #9d4edd);
  color: white; border: none;
  padding: 14px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 20px;
}
.login-btn:hover { opacity: 0.9; transform: translateY(-2px); }
.back-link {
  color: var(--text-muted); font-size: 0.85rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--primary); }

/* ===== Admin Panel Layout ===== */
.admin-panel { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo {
  font-size: 1.3rem; font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
}
.sidebar-logo span { color: var(--primary); }
.sidebar-close {
  display: none; background: none; border: none;
  color: var(--text-muted); font-size: 1.1rem;
  cursor: pointer; padding: 4px;
}
.sidebar-nav {
  padding: 16px 12px;
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-item i { width: 18px; text-align: center; }
.nav-item:hover { background: var(--primary-light); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item.danger:hover { background: rgba(255,101,132,0.1); color: var(--danger); }
.nav-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ===== Admin Main ===== */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ===== Topbar ===== */
.admin-topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0;
  background: rgba(15,14,23,0.95);
  backdrop-filter: blur(10px);
  z-index: 50;
}
.sidebar-toggle {
  background: none; border: none;
  color: var(--text); font-size: 1.1rem;
  cursor: pointer; padding: 8px;
  border-radius: var(--radius-sm);
  display: none;
  transition: background 0.2s;
}
.sidebar-toggle:hover { background: var(--primary-light); }
.topbar-title {
  font-size: 1rem; font-weight: 700;
  flex: 1;
}
.save-btn {
  background: linear-gradient(135deg, var(--primary), #9d4edd);
  color: white; border: none;
  padding: 9px 20px;
  border-radius: 50px;
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: opacity 0.2s, transform 0.2s;
}
.save-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== Content Area ===== */
.admin-content {
  padding: 28px;
  flex: 1;
  max-width: 900px;
}

/* ===== Tab Panels ===== */
.tab-panel { display: none; }
.tab-panel.active { display: flex; flex-direction: column; gap: 24px; }

/* ===== Panel Cards ===== */
.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.panel-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.panel-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; }

/* ===== Forms ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.form-group {
  display: flex; flex-direction: column; gap: 6px;
}
.form-group label {
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text); font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group select option { background: var(--card-bg); }

/* ===== Buttons ===== */
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { background: var(--primary); color: white; }
.btn-add {
  background: var(--primary);
  color: white; border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: opacity 0.2s;
}
.btn-add:hover { opacity: 0.85; }
.btn-add-full {
  width: 100%;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px dashed var(--primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-add-full:hover { background: var(--primary); color: white; }

/* ===== Form Rows ===== */
.form-row {
  display: flex; gap: 10px; align-items: center;
}
.form-row.wrap { flex-wrap: wrap; }
.form-row input { flex: 1; min-width: 120px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text); font-size: 0.9rem; outline: none;
  transition: border-color 0.2s;
}
.form-row input:focus { border-color: var(--primary); }
.range-wrap {
  display: flex; align-items: center; gap: 8px;
  min-width: 160px;
}
.range-wrap input[type="range"] {
  flex: 1; accent-color: var(--primary);
}
.range-wrap span {
  font-size: 0.8rem; font-weight: 700; color: var(--primary);
  min-width: 36px;
}
.add-item-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.add-item-form h4 {
  font-size: 0.9rem; font-weight: 700;
  color: var(--text-muted); margin-bottom: 12px;
}

/* ===== Menu List ===== */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: border-color 0.2s;
}
.menu-item:hover { border-color: var(--primary); }
.drag-handle { cursor: grab; color: var(--text-muted); font-size: 0.85rem; }
.menu-item-label { flex: 1; }
.menu-item-label input {
  background: transparent; border: none;
  color: var(--text); font-size: 0.9rem; font-weight: 500;
  outline: none; width: 100%;
}
.menu-item-id { font-size: 0.75rem; color: var(--text-muted); }
.toggle-switch {
  position: relative; width: 42px; height: 22px;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 11px;
  background: rgba(255,255,255,0.1);
  cursor: pointer; transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: white; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.btn-delete {
  background: none; border: none;
  color: var(--text-muted); font-size: 0.85rem;
  cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: all 0.2s;
}
.btn-delete:hover { color: var(--danger); background: rgba(255,101,132,0.1); }

/* ===== Items List (Skills, Exp, Edu, Portfolio) ===== */
.items-list { display: flex; flex-direction: column; gap: 10px; }
.item-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: border-color 0.2s;
}
.item-card:hover { border-color: rgba(108,99,255,0.4); }
.item-info { flex: 1; }
.item-title {
  font-size: 0.9rem; font-weight: 600; margin-bottom: 2px;
}
.item-sub { font-size: 0.8rem; color: var(--text-muted); }
.item-badge {
  font-size: 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 50px;
  margin-left: 8px;
}
.item-actions { display: flex; gap: 4px; flex-shrink: 0; margin-top: 2px; }
.btn-edit {
  background: none; border: none;
  color: var(--text-muted); font-size: 0.8rem;
  cursor: pointer; padding: 4px 8px;
  border-radius: 4px; transition: all 0.2s;
}
.btn-edit:hover { color: var(--primary); background: var(--primary-light); }

/* ===== Color Grid ===== */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.color-item { display: flex; flex-direction: column; gap: 6px; }
.color-item label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.color-input-wrap { display: flex; gap: 8px; align-items: center; }
.color-input-wrap input[type="color"] {
  width: 42px; height: 42px;
  border: none; border-radius: var(--radius-sm);
  background: none; cursor: pointer; padding: 2px;
}
.color-input-wrap input[type="text"] {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text); font-size: 0.85rem;
  outline: none; transition: border-color 0.2s;
}
.color-input-wrap input[type="text"]:focus { border-color: var(--primary); }

/* ===== Presets ===== */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.preset-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  color: var(--text-muted); font-size: 0.8rem;
}
.preset-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.preset-colors {
  display: flex; justify-content: center; gap: 6px; margin-bottom: 8px;
}
.preset-colors span {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
}

/* ===== Logo Options ===== */
.radio-group { display: flex; gap: 20px; margin-bottom: 16px; }
.radio-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.9rem; cursor: pointer; color: var(--text-muted);
}
.radio-label input[type="radio"] { accent-color: var(--primary); }

/* ===== Upload Area ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area i { font-size: 2rem; display: block; margin-bottom: 8px; }
.upload-area p { font-size: 0.85rem; margin-bottom: 4px; }
.upload-area small { font-size: 0.75rem; }
.img-preview {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.img-preview img {
  width: 100%; max-height: 200px;
  object-fit: contain;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  max-width: 400px; width: 90%;
  text-align: center;
}
.modal-icon { font-size: 2.5rem; color: var(--warning); margin-bottom: 16px; }
.modal-box h3 { font-size: 1.2rem; margin-bottom: 8px; }
.modal-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }
.btn-modal-cancel {
  padding: 10px 24px;
  border-radius: 50px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-modal-cancel:hover { background: rgba(255,255,255,0.1); }
.btn-modal-confirm {
  padding: 10px 24px;
  border-radius: 50px;
  background: var(--danger);
  border: none; color: white;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s;
}
.btn-modal-confirm:hover { opacity: 0.85; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.9rem; font-weight: 500;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  z-index: 9999;
  opacity: 0; transform: translateY(20px);
  transition: all 0.3s;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex !important; align-items: center; }
}
@media (max-width: 600px) {
  .admin-content { padding: 16px; }
  .panel-card { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: 1fr; }
  .presets-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; align-items: stretch; }
  .topbar-title { display: none; }
}
