/* ============================================
   AstroChat - Main Stylesheet
   Cosmic Luxury Design
   ============================================ */

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

:root {
    --gold: #D4A843;
    --gold-light: #F0C96B;
    --gold-dark: #A67C20;
    --deep: #0D0B1E;
    --deep2: #16132E;
    --deep3: #1E1A3A;
    --purple: #6C4BD8;
    --purple-light: #8B6FE8;
    --accent: #FF6B9D;
    --text: #E8E4F5;
    --text-muted: #9B96BC;
    --border: rgba(212,168,67,0.2);
    --card-bg: rgba(30,26,58,0.9);
    --radius: 14px;
    --shadow: 0 8px 32px rgba(0,0,0,0.5);
    --success: #4CAF50;
    --danger: #f44336;
    --warning: #FF9800;
}

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

body {
    background: var(--deep);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(108,75,216,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(212,168,67,0.06) 0%, transparent 50%);
}

a { color: var(--gold-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); }

/* ---- Navbar ---- */
.navbar {
    background: rgba(13,11,30,0.95);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.nav-logo {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-logo span { color: var(--gold-light); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--gold-light); }
.nav-wallet {
    background: rgba(212,168,67,0.1);
    border: 1px solid var(--border);
    color: var(--gold-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--deep);
    box-shadow: 0 4px 15px rgba(212,168,67,0.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212,168,67,0.4); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--gold-light);
}
.btn-outline:hover { background: rgba(212,168,67,0.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* ---- Cards ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(108,75,216,0.2); }

/* ---- Astrologer Card ---- */
.astro-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.25s;
    position: relative;
}
.astro-card:hover { transform: translateY(-4px); border-color: rgba(212,168,67,0.4); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.astro-card .free-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.astro-card .astro-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
}
.astro-card .status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--deep);
    position: absolute;
    bottom: 2px;
    right: 2px;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: #666; }
.status-dot.busy { background: var(--warning); }
.status-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}
.status-badge.online { background: rgba(76,175,80,0.15); color: var(--success); border: 1px solid rgba(76,175,80,0.3); }
.status-badge.offline { background: rgba(100,100,100,0.15); color: #999; border: 1px solid rgba(100,100,100,0.3); }
.status-badge.busy { background: rgba(255,152,0,0.15); color: var(--warning); border: 1px solid rgba(255,152,0,0.3); }
.stars { color: var(--gold); font-size: 13px; }

/* ---- Grid ---- */
.astro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* ---- Hero Section ---- */
.hero {
    background: linear-gradient(135deg, var(--deep2) 0%, rgba(108,75,216,0.15) 50%, var(--deep2) 100%);
    padding: 4rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212,168,67,0.04) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.hero h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(212,168,67,0.3);
    margin-bottom: 1rem;
    position: relative;
}
.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    position: relative;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-control {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: rgba(212,168,67,0.5);
    box-shadow: 0 0 0 3px rgba(212,168,67,0.1);
}
.form-control option { background: var(--deep2); }
select.form-control { cursor: pointer; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 2.5rem 0; }

/* ---- Filter Bar ---- */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.filter-bar select, .filter-bar input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    outline: none;
    min-width: 150px;
}
.filter-bar input { min-width: 200px; }

/* ---- Auth Modal / Page ---- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-image: radial-gradient(ellipse at center, rgba(108,75,216,0.12) 0%, transparent 70%);
}
.auth-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-title {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 0.4rem;
}
.auth-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 2rem; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -1px;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Chat Page ---- */
.chat-wrap {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 65px);
}
.chat-sidebar {
    background: var(--deep2);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.chat-main {
    display: flex;
    flex-direction: column;
}
.chat-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.message-bubble {
    max-width: 65%;
    padding: 10px 15px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}
.message-bubble.user {
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message-bubble.astrologer {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.message-time { font-size: 11px; opacity: 0.6; margin-top: 4px; text-align: right; }
.chat-input-area {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}
.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
}
.chat-input:focus { border-color: rgba(212,168,67,0.4); }

/* ---- Timer Bar ---- */
.timer-bar {
    background: var(--deep2);
    border-bottom: 1px solid var(--border);
    padding: 8px 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.timer-display {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--success);
    min-width: 60px;
}
.timer-display.warning { color: var(--warning); }
.timer-display.danger { color: var(--danger); }
.timer-progress {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--gold));
    border-radius: 3px;
    transition: width 1s linear;
}
.timer-label { font-size: 12px; color: var(--text-muted); }

/* ---- Session End Overlay ---- */
.session-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.session-popup {
    background: var(--deep2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    max-width: 420px;
    width: 100%;
    animation: popIn 0.3s ease;
}
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.session-popup h3 { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--gold); margin-bottom: 0.5rem; }
.session-popup p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ---- Wallet / Recharge Packs ---- */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.pack-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.pack-card:hover, .pack-card.selected {
    border-color: var(--gold);
    background: rgba(212,168,67,0.08);
    transform: translateY(-2px);
}
.pack-amount { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--gold); font-weight: 700; }
.pack-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.pack-bonus { font-size: 11px; color: var(--success); margin-top: 4px; font-weight: 600; }

/* ---- Dashboard Sidebar ---- */
.dashboard-wrap { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 65px); }
.dash-sidebar {
    background: var(--deep2);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
}
.dash-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 1.5rem;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}
.dash-sidebar .nav-item:hover, .dash-sidebar .nav-item.active {
    background: rgba(212,168,67,0.08);
    color: var(--gold-light);
    border-right: 2px solid var(--gold);
}
.dash-main { padding: 2rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--gold); margin-top: 4px; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ---- Alert ---- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; }
.alert-success { background: rgba(76,175,80,0.12); border: 1px solid rgba(76,175,80,0.3); color: #81C784; }
.alert-danger { background: rgba(244,67,54,0.12); border: 1px solid rgba(244,67,54,0.3); color: #EF9A9A; }
.alert-info { background: rgba(108,75,216,0.12); border: 1px solid rgba(108,75,216,0.3); color: #B39DDB; }
.alert-warning { background: rgba(255,152,0,0.12); border: 1px solid rgba(255,152,0,0.3); color: #FFCC80; }

/* ---- Footer ---- */
footer {
    background: var(--deep2);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
footer a { color: var(--gold-light); }

/* ---- Typing indicator ---- */
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 10px 15px; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: bounce 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ---- Review Stars ---- */
.star-input { display: flex; gap: 4px; cursor: pointer; }
.star-input .star { font-size: 24px; color: var(--text-muted); transition: color 0.1s; }
.star-input .star.active, .star-input .star:hover { color: var(--gold); }

/* ---- Notifications ---- */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}
.toast-success { background: rgba(76,175,80,0.9); color: #fff; border: 1px solid rgba(76,175,80,0.5); }
.toast-error { background: rgba(244,67,54,0.9); color: #fff; border: 1px solid rgba(244,67,54,0.5); }
.toast-info { background: rgba(108,75,216,0.9); color: #fff; border: 1px solid rgba(108,75,216,0.5); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Section Heading ---- */
.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold);
    margin-bottom: 0.3rem;
}
.section-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 1.5rem; }

/* ---- Rating Display ---- */
.rating-display { display: flex; align-items: center; gap: 6px; }
.rating-val { font-size: 13px; font-weight: 600; color: var(--gold); }
.review-count { font-size: 12px; color: var(--text-muted); }

/* ---- Tags ---- */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(108,75,216,0.15);
    color: var(--purple-light);
    border: 1px solid rgba(108,75,216,0.25);
    margin: 2px;
}

/* ---- Spinner ---- */
.spinner {
    width: 30px; height: 30px;
    border: 3px solid rgba(212,168,67,0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 1rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .chat-wrap { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
    .dashboard-wrap { grid-template-columns: 1fr; }
    .dash-sidebar { display: none; }
    .navbar { padding: 0 1rem; }
    .hero { padding: 2.5rem 1rem; }
}
