/* ========================================================
   ANIME SOCIAL HUB - Design System & Base Layout
   Theme: Anime Cute + Modern Dashboard
   Palette: Purple, Blue, Pink, White, Gold Accent
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  /* Color Palette */
  --purple-primary: #7C5CFC;
  --purple-light: #9C88FF;
  --purple-dark: #583BBF;
  --purple-soft: #F0EDFF;
  
  --blue-primary: #0984E3;
  --blue-neon: #70A6FF;
  --blue-soft: #E8F4FD;
  --cyan-neon: #00CEC9;

  --pink-primary: #FD79A8;
  --pink-light: #FF9EB8;
  --pink-soft: #FFF0F5;
  --pink-deep: #E84393;

  --gold-accent: #FDCB6E;
  --gold-light: #FFEAA7;
  --gold-glow: #F39C12;

  --white: #FFFFFF;
  --bg-gradient: linear-gradient(135deg, #F8F9FE 0%, #F1F3FF 50%, #FCF5F8 100%);
  --card-glass: rgba(255, 255, 255, 0.92);
  --card-glass-hover: rgba(255, 255, 255, 0.98);
  
  --text-main: #2D3436;
  --text-muted: #636E72;
  --text-light: #B2BEC3;
  --border-glass: rgba(124, 92, 252, 0.12);
  --border-focus: rgba(124, 92, 252, 0.4);

  /* Shadows & Glow */
  --shadow-sm: 0 4px 14px rgba(124, 92, 252, 0.06);
  --shadow-md: 0 8px 24px rgba(124, 92, 252, 0.10);
  --shadow-lg: 0 16px 36px rgba(124, 92, 252, 0.16);
  --shadow-neon: 0 0 20px rgba(124, 92, 252, 0.25);
  --shadow-gold: 0 0 16px rgba(253, 203, 110, 0.45);
  --shadow-pink: 0 0 16px rgba(253, 121, 168, 0.35);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Nunito', sans-serif;

  --sidebar-width: 270px;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background floating decorative anime bubbles/particles */
body::before {
  content: '';
  position: fixed;
  top: -100px;
  right: -80px;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 121, 168, 0.15) 0%, rgba(124, 92, 252, 0.05) 70%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px;
  left: -80px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(9, 132, 227, 0.12) 0%, rgba(124, 92, 252, 0.05) 70%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* App Wrapper */
#app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  height: 44px;
  width: auto;
}

.nav-menu {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  list-style: none;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: 1.2px;
  padding: 12px 14px 6px;
  text-transform: uppercase;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  position: relative;
}

.nav-link i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: var(--purple-primary);
  background: var(--purple-soft);
  transform: translateX(4px);
}

.nav-link:hover i {
  transform: scale(1.15);
}

.nav-link.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
  box-shadow: 0 4px 15px rgba(124, 92, 252, 0.35);
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--pink-primary);
  color: var(--white);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.user-avatar-mini {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--purple-primary), var(--pink-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.user-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info-mini {
  flex: 1;
  min-width: 0;
}

.user-name-mini {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--purple-soft);
  color: var(--purple-primary);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-logout:hover {
  color: #ff7675;
  background: rgba(255, 118, 117, 0.1);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--purple-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.page-title-box h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-create-post {
  background: linear-gradient(135deg, var(--purple-primary) 0%, var(--pink-primary) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(124, 92, 252, 0.3);
}

.btn-create-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 92, 252, 0.4);
}

.btn-run-worker {
  background: var(--white);
  color: var(--purple-primary);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
}

.btn-run-worker:hover {
  background: var(--purple-soft);
}

/* Page View Content Container */
.page-container {
  padding: 28px;
  flex: 1;
}

/* Base Card */
.anime-card {
  background: var(--card-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.anime-card:hover {
  box-shadow: var(--shadow-md);
}

.anime-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(124, 92, 252, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 92, 252, 0.4);
}

.btn-pink {
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(253, 121, 168, 0.35);
}

.btn-pink:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(253, 121, 168, 0.45);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-accent) 100%);
  color: #5d4037;
  box-shadow: 0 4px 15px rgba(253, 203, 110, 0.4);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(253, 203, 110, 0.5);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--purple-light);
  color: var(--purple-primary);
}

.btn-outline:hover {
  background: var(--purple-soft);
}

.btn-danger {
  background: #ff7675;
  color: var(--white);
}

.btn-danger:hover {
  background: #d63031;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(45, 52, 54, 0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-glass);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 28px;
  position: relative;
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--purple-soft);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--purple-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: var(--pink-soft);
  color: var(--pink-deep);
  transform: rotate(90deg);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow-md);
  border-left: 5px solid var(--purple-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
  font-weight: 700;
  font-size: 13.5px;
}

.toast-success { border-left-color: #2ecc71; }
.toast-error { border-left-color: #ff7675; }
.toast-warning { border-left-color: var(--gold-accent); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
  }
  .sidebar {
    transform: translateX(-100%);
    width: 270px;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .btn-mobile-toggle {
    display: inline-block;
  }
}
