/* ==========================================
   AIAstrology.site - Cosmic Theme CSS
   ========================================== */


:root {
  --cosmic-dark: #0a0015;
  --cosmic-deep: #120025;
  --cosmic-mid: #1e0040;
  --purple-bright: #9b30ff;
  --purple-light: #c77dff;
  --gold: #ffd700;
  --gold-light: #ffe866;
  --teal: #00d4d4;
  --pink: #ff6eb4;
  --blue-star: #4fc3f7;
  --text-main: #f0e6ff;
  --text-muted: #a88dc8;
  --card-bg: rgba(30, 0, 64, 0.7);
  --card-border: rgba(155, 48, 255, 0.3);
  --success: #00e676;
  --danger: #ff4444;
  --warning: #ffb300;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cosmic-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---- STARS BACKGROUND ---- */
.stars-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(83,0,150,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0,100,200,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(150,0,100,0.1) 0%, transparent 50%),
    var(--cosmic-dark);
  pointer-events: none;
}
.stars-bg::before, .stars-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 10%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 50%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 25%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 70%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 85%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 75%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 90%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 80% 80%, rgba(200,150,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 40%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 45%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 20% 55%, rgba(150,200,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 30%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 5%, rgba(255,215,0,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 15%, white 0%, transparent 100%),
    radial-gradient(2px 2px at 35% 60%, rgba(255,100,180,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 40%, white 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 70%, rgba(255,255,255,0.5) 0%, transparent 100%);
  animation: twinkle 4s infinite alternate;
}
.stars-bg::after {
  animation: twinkle 6s infinite alternate-reverse;
  animation-delay: 2s;
}
@keyframes twinkle {
  0%   { opacity: 0.5; }
  50%  { opacity: 1; }
  100% { opacity: 0.7; }
}

/* ---- LAYOUT ---- */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ---- NAVBAR ---- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 0, 21, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(155,48,255,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
}
.navbar-brand .logo-icon { font-size: 28px; animation: spin-slow 8s linear infinite; }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
}
.nav-links a:hover { color: var(--purple-light); background: rgba(155,48,255,0.1); }
.nav-links a.active { color: var(--gold); background: rgba(255,215,0,0.08); }
.btn-nav {
  background: linear-gradient(135deg, var(--purple-bright), #6600cc);
  color: white !important;
  padding: 8px 20px !important;
  border-radius: 25px !important;
  font-weight: 500;
  box-shadow: 0 0 15px rgba(155,48,255,0.4);
  transition: all 0.3s !important;
}
.btn-nav:hover { box-shadow: 0 0 25px rgba(155,48,255,0.7) !important; transform: translateY(-1px); }

/* ---- CARDS ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  overflow: hidden;
}
.card:hover {
  border-color: rgba(155,48,255,0.6);
  box-shadow: 0 0 30px rgba(155,48,255,0.2);
  transform: translateY(-2px);
}
.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(155,48,255,0.15);
}
.card-body { padding: 24px; }
.card-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 4px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: all 0.3s;
}
.btn-primary {
  background: linear-gradient(135deg, #9b30ff, #6600cc);
  color: white;
  box-shadow: 0 4px 20px rgba(155,48,255,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(155,48,255,0.55); transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #cc9900);
  color: #0a0015;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(255,215,0,0.3);
}
.btn-gold:hover { box-shadow: 0 6px 30px rgba(255,215,0,0.5); transform: translateY(-2px); }
.btn-teal {
  background: linear-gradient(135deg, #00d4d4, #007777);
  color: white;
  box-shadow: 0 4px 20px rgba(0,212,212,0.3);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--purple-light); color: var(--purple-light); }
.btn-danger { background: linear-gradient(135deg, #ff4444, #aa0000); color: white; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 0, 30, 0.6);
  border: 1px solid rgba(155,48,255,0.25);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s;
  outline: none;
}
.form-control:focus {
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 3px rgba(155,48,255,0.15);
  background: rgba(10, 0, 40, 0.8);
}
.form-control::placeholder { color: rgba(168,141,200,0.5); }
select.form-control option { background: #1e0040; color: var(--text-main); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(0,230,118,0.1); border: 1px solid rgba(0,230,118,0.3); color: #00e676; }
.alert-danger  { background: rgba(255,68,68,0.1);  border: 1px solid rgba(255,68,68,0.3);  color: #ff6666; }
.alert-info    { background: rgba(79,195,247,0.1); border: 1px solid rgba(79,195,247,0.3); color: #4fc3f7; }
.alert-warning { background: rgba(255,179,0,0.1);  border: 1px solid rgba(255,179,0,0.3);  color: #ffb300; }

/* ---- BADGE ---- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-purple { background: rgba(155,48,255,0.2); color: var(--purple-light); border: 1px solid rgba(155,48,255,0.4); }
.badge-gold   { background: rgba(255,215,0,0.15); color: var(--gold); border: 1px solid rgba(255,215,0,0.4); }
.badge-teal   { background: rgba(0,212,212,0.15); color: var(--teal); border: 1px solid rgba(0,212,212,0.4); }
.badge-free   { background: rgba(100,100,100,0.2); color: #aaa; border: 1px solid rgba(100,100,100,0.3); }
.badge-admin  { background: rgba(255,100,100,0.15); color: #ff8888; border: 1px solid rgba(255,100,100,0.3); }

/* ---- DASHBOARD GRID ---- */
.dash-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 65px);
}
.sidebar {
  background: rgba(10,0,30,0.9);
  border-right: 1px solid rgba(155,48,255,0.15);
  padding: 24px 0;
}
.sidebar-menu { list-style: none; }
.sidebar-menu li { padding: 2px 12px; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s;
}
.sidebar-menu a:hover, .sidebar-menu a.active {
  color: var(--purple-light);
  background: rgba(155,48,255,0.1);
}
.sidebar-menu a.active { border-left: 3px solid var(--purple-bright); }
.sidebar-icon { font-size: 18px; }
.sidebar-user {
  padding: 20px 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(155,48,255,0.15);
}
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-bright), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
  color: white;
  margin-bottom: 8px;
}
.main-content { padding: 28px 32px; overflow-y: auto; }

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.1;
}
.stat-card.purple::before { background: var(--purple-bright); }
.stat-card.gold::before   { background: var(--gold); }
.stat-card.teal::before   { background: var(--teal); }
.stat-card.pink::before   { background: var(--pink); }
.stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-num  { font-size: 28px; font-weight: 700; font-family: 'Cinzel', serif; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- FEATURES SECTION ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.feature-card:hover {
  border-color: var(--purple-bright);
  box-shadow: 0 0 40px rgba(155,48,255,0.25);
  transform: translateY(-4px);
}
.feature-icon { font-size: 40px; margin-bottom: 14px; display: block; }
.feature-title { font-family: 'Cinzel', serif; font-size: 15px; color: var(--gold); margin-bottom: 8px; }
.feature-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.feature-badge { margin-top: 12px; }

/* ---- AI LOADING SPINNER ---- */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px;
}
.cosmic-spinner {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(155,48,255,0.2);
  border-top-color: var(--purple-bright);
  border-right-color: var(--gold);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- CHAT ---- */
.chat-container { height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.chat-message { max-width: 80%; }
.chat-message.user { align-self: flex-end; }
.chat-message.ai   { align-self: flex-start; }
.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--purple-bright), #6600cc);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-message.ai .chat-bubble {
  background: rgba(30,0,64,0.8);
  border: 1px solid rgba(155,48,255,0.3);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}
.chat-input-row {
  display: flex; gap: 10px;
  padding: 16px;
  border-top: 1px solid rgba(155,48,255,0.15);
}

/* ---- TABLES ---- */
.table-cosmic { width: 100%; border-collapse: collapse; }
.table-cosmic th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(155,48,255,0.2);
  font-weight: 500;
}
.table-cosmic td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(155,48,255,0.08);
}
.table-cosmic tr:hover td { background: rgba(155,48,255,0.04); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--cosmic-deep);
  border: 1px solid rgba(155,48,255,0.4);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 0 60px rgba(155,48,255,0.2);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(0.9); } to { opacity:1; transform: scale(1); } }

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(20,0,45,0.9);
  border: 1px solid rgba(155,48,255,0.35);
  border-radius: 24px;
  padding: 48px 40px;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 80px rgba(155,48,255,0.2);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo-icon { font-size: 48px; display: block; margin-bottom: 8px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-8px); } }
.auth-title { font-family: 'Cinzel', serif; font-size: 24px; color: var(--gold); text-align: center; margin-bottom: 8px; }
.auth-subtitle { color: var(--text-muted); text-align: center; font-size: 14px; margin-bottom: 32px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background: rgba(155,48,255,0.2); }
.auth-divider span { color: var(--text-muted); font-size: 12px; }

/* ---- GLOWING TEXT ---- */
.glow-text { text-shadow: 0 0 20px currentColor; }
.glow-purple { color: var(--purple-light); text-shadow: 0 0 20px rgba(155,48,255,0.6); }
.glow-gold   { color: var(--gold); text-shadow: 0 0 20px rgba(255,215,0,0.6); }
.glow-teal   { color: var(--teal); text-shadow: 0 0 20px rgba(0,212,212,0.6); }

/* ---- PAGE HEADER ---- */
.page-header {
  margin-bottom: 28px;
}
.page-title {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  color: var(--gold);
  margin-bottom: 6px;
}
.page-subtitle { color: var(--text-muted); font-size: 14px; }

/* ---- READING RESULT ---- */
.reading-result {
  background: rgba(10,0,40,0.8);
  border: 1px solid rgba(155,48,255,0.3);
  border-radius: 16px;
  padding: 28px;
  margin-top: 24px;
  line-height: 1.8;
  font-size: 15px;
  white-space: pre-wrap;
}
.reading-result h3 { font-family: 'Cinzel', serif; color: var(--gold); margin-bottom: 12px; font-size: 18px; }

/* ---- ZODIAC GRID ---- */
.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.zodiac-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 12px;
}
.zodiac-item:hover, .zodiac-item.selected {
  border-color: var(--purple-bright);
  background: rgba(155,48,255,0.15);
  color: var(--purple-light);
}
.zodiac-item .zi { font-size: 24px; display: block; margin-bottom: 4px; }

/* ---- TAROT CARDS ---- */
.tarot-grid { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.tarot-card {
  width: 120px; height: 180px;
  background: linear-gradient(135deg, #1e0040, #0a0030);
  border: 2px solid rgba(155,48,255,0.4);
  border-radius: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.5s;
  position: relative;
  overflow: hidden;
}
.tarot-card::before {
  content: '✦';
  position: absolute;
  font-size: 60px;
  color: rgba(155,48,255,0.1);
}
.tarot-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(255,215,0,0.3);
  transform: translateY(-8px) rotate(2deg);
}
.tarot-card.revealed { border-color: var(--gold); background: linear-gradient(135deg, #2d0050, #100030); }
.tarot-emoji { font-size: 36px; position: relative; z-index: 1; }
.tarot-name  { font-size: 11px; text-align: center; color: var(--gold); margin-top: 8px; font-family: 'Cinzel', serif; position: relative; z-index: 1; padding: 0 8px; }

/* ---- CREDIT BAR ---- */
.credit-bar {
  background: rgba(10,0,30,0.8);
  border: 1px solid rgba(155,48,255,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.credit-progress {
  flex: 1;
  height: 6px;
  background: rgba(155,48,255,0.15);
  border-radius: 99px;
  overflow: hidden;
}
.credit-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--purple-bright), var(--gold));
  transition: width 0.5s;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .navbar { padding: 12px 16px; }
  .main-content { padding: 16px; }
  .auth-card { padding: 32px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cosmic-dark); }
::-webkit-scrollbar-thumb { background: rgba(155,48,255,0.4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(155,48,255,0.7); }

/* ---- UTILITIES ---- */
.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-gold    { color: var(--gold); }
.text-purple  { color: var(--purple-light); }
.text-teal    { color: var(--teal); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 8px;  } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.p-3 { padding: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.hidden { display: none; }
.divider { border: none; border-top: 1px solid rgba(155,48,255,0.12); margin: 20px 0; }

/* ---- ANIMATIONS ---- */
.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.6; } }

/* Page transitions */
.page-enter { animation: pageEnter 0.4s ease; }
@keyframes pageEnter {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}
