/**
 * RODAN.FUN — Command Center & Admin Panel Stylesheet
 * Luxury Obsidian Glassmorphism, Specular Edge Reflections, Neon Rose/Purple Glow
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-canvas: #090305;
  --bg-card-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 60%, rgba(0, 0, 0, 0.5) 100%);
  --bg-nav-glass: rgba(18, 8, 12, 0.85);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.78);
  --text-muted: rgba(255, 255, 255, 0.48);
  --accent-rose: #E11D48;
  --accent-pink: #FF2E5B;
  --accent-purple: #A855F7;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-hover: rgba(255, 255, 255, 0.32);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --card-radius: 24px;
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* AMBIENT GLOW ORBS */
.ambient-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.25;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #E11D48 0%, rgba(225, 29, 72, 0) 70%);
  top: -120px;
  left: -120px;
  animation: orbDrift1 22s infinite alternate ease-in-out;
}

.orb-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #9333EA 0%, rgba(147, 51, 234, 0) 70%);
  bottom: -100px;
  right: -100px;
  animation: orbDrift2 26s infinite alternate ease-in-out;
}

@keyframes orbDrift1 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 80px); }
}

@keyframes orbDrift2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-80px, -60px); }
}

/* LOGIN VIEW SCREEN */
.auth-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  max-width: 480px;
  width: 100%;
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(225, 29, 72, 0.25);
  text-align: center;
}

.auth-shield-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  border: 1px solid rgba(225, 29, 72, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  color: #FDA4AF;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.35);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(225, 29, 72, 0.3);
  color: #FDA4AF;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 1.85rem;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 28px;
}

.auth-form-group {
  position: relative;
  margin-bottom: 20px;
  text-align: left;
}

.auth-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input-wrapper {
  position: relative;
  width: 100%;
}

.auth-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px 48px 14px 16px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.22s ease;
}

.auth-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: #E11D48;
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.3);
}

.auth-toggle-pwd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.auth-toggle-pwd:hover {
  color: #FFFFFF;
}

.auth-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #E11D48 0%, #A855F7 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 16px;
  padding: 15px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: inherit;
  box-shadow: 0 6px 22px rgba(225, 29, 72, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(225, 29, 72, 0.55);
}

.auth-error-msg {
  color: #F87171;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: none;
}

/* ADMIN DASHBOARD (LOGGED IN) */
.admin-dashboard {
  position: relative;
  z-index: 10;
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
  display: none;
}

/* TOP NAVBAR */
.admin-nav {
  background: var(--bg-nav-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

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

.admin-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
}

.admin-brand-pill {
  background: linear-gradient(135deg, #E11D48, #9333EA);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6EE7B7;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: #FFFFFF;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--glass-border-hover);
}

.btn-logout {
  color: #F87171;
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #F87171;
}

/* STATS OVERVIEW CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  transition: all 0.25s ease;
}

.stat-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FDA4AF;
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* PROGRESS GAUGE */
.storage-gauge-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  margin-top: 10px;
  overflow: hidden;
}

.storage-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #60A5FA);
  border-radius: 9999px;
  width: 8%;
}

/* SECTION TABS */
.admin-tabs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  color: #FFFFFF;
  background: rgba(225, 29, 72, 0.15);
  border: 1px solid rgba(225, 29, 72, 0.35);
  box-shadow: 0 0 16px rgba(225, 29, 72, 0.25);
}

/* CATALOG ACTION BAR */
.catalog-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.catalog-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.catalog-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 16px 10px 42px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.catalog-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.btn-primary {
  background: linear-gradient(135deg, #E11D48 0%, #A855F7 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  padding: 11px 22px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.4);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(225, 29, 72, 0.55);
}

/* AUDIOBOOK CATALOG TABLE */
.catalog-card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.catalog-table-wrap {
  overflow-x: auto;
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.catalog-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 20px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.catalog-table td {
  padding: 16px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.catalog-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.book-thumb-cell {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #250910;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.book-title-cell {
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.book-author-cell {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.pill-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pill-tag-gdrive {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93C5FD;
}

.row-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-icon-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  transform: scale(1.05);
}

.btn-icon-delete:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

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

.modal-card {
  background: #15070C;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  max-width: 560px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(225, 29, 72, 0.25);
  transform: translateY(20px) scale(0.97);
  transition: all 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #FFFFFF;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 16px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: #E11D48;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 14px rgba(225, 29, 72, 0.25);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .admin-nav {
    flex-direction: column;
    gap: 12px;
    border-radius: 20px;
  }
  
  .catalog-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-search {
    max-width: 100%;
  }
}
