/* VibVex — Main Stylesheet */
:root {
    --pink: #ff4d8d;
    --pink-dark: #d63870;
    --purple: #8b2fc9;
    --dark: #0d0d14;
    --card: #16161f;
    --card2: #1e1e2e;
    --border: #2a2a3d;
    --text: #f0f0f0;
    --muted: #888;
    --green: #00e676;
    --gold: #ffd700;
}

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

body {
    background: var(--dark);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
}

a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--pink-dark); }

/* NAV */
nav {
    background: rgba(13,13,20,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 8px; align-items: center; }

.btn {
    padding: 8px 20px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); color: white; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--pink); color: var(--pink); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }

.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* HERO */
.hero {
    text-align: center;
    padding: 80px 24px 60px;
    background: radial-gradient(ellipse at 50% 0%, rgba(139,47,201,0.2) 0%, transparent 70%);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-badges {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.badge {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--muted);
}

.badge .dot {
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* SECTION */
.section { padding: 48px 24px; max-width: 1200px; margin: 0 auto; }
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-dot {
    width: 10px; height: 10px;
    background: #ff3b3b;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* PROFILE GRID */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.profile-card:hover {
    border-color: var(--pink);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(255,77,141,0.15);
}

.profile-card .avatar {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--card2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.profile-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card .avatar-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, var(--card2), var(--border));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.profile-card .info {
    padding: 12px;
}

.profile-card .name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.profile-card .status {
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-live { color: #ff3b3b; font-weight: 600; }
.status-online { color: var(--green); }

.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff3b3b;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* FORMS */
.form-container {
    max-width: 420px;
    margin: 60px auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 32px;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--pink);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--muted);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}
.alert-error { background: rgba(255,59,59,0.15); border: 1px solid rgba(255,59,59,0.3); color: #ff6b6b; }
.alert-success { background: rgba(0,230,118,0.1); border: 1px solid rgba(0,230,118,0.2); color: var(--green); }

/* ROOM */
.room-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    height: calc(100vh - 60px);
}

.video-area {
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#local-video, #remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#host-cam-video {
    width: 100%;
    height: 100%;
}

#host-cam-video video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#local-video {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 160px;
    height: 90px;
    border-radius: 10px;
    border: 2px solid var(--pink);
    z-index: 10;
    object-fit: cover;
}

.video-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.ctrl-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctrl-btn-default { background: rgba(255,255,255,0.15); color: white; }
.ctrl-btn-default:hover { background: rgba(255,255,255,0.25); }
.ctrl-btn-danger { background: #ff3b3b; color: white; }
.ctrl-btn-danger:hover { background: #cc0000; }

.chat-sidebar {
    background: var(--card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    font-size: 0.875rem;
    line-height: 1.4;
}

.chat-msg .chat-user {
    font-weight: 700;
    color: var(--pink);
    margin-right: 6px;
}

.chat-input-area {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.chat-input-area input {
    flex: 1;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.875rem;
    outline: none;
}

.chat-input-area input:focus { border-color: var(--pink); }

/* CREDITS */
.credits-display {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.credits-display .coin { color: var(--gold); }

/* PROFILE PAGE */
.profile-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
}

.profile-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.profile-avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--card2);
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid var(--pink);
}

.profile-meta h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.profile-meta p { color: var(--muted); margin-bottom: 12px; }

/* FOOTER */
footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .room-container { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
    .chat-sidebar { height: 300px; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

    /* Nav: compact icons on mobile, no overflow */
    nav { padding: 0 10px; height: 52px; gap: 4px; }
    .nav-logo { font-size: 1.1rem; }
    .nav-links { gap: 3px; flex-wrap: nowrap; overflow: hidden; }
    .nav-links .btn { padding: 6px 8px; font-size: 0.75rem; white-space: nowrap; }
    .nav-links .btn-ghost { padding: 6px; font-size: 0.8rem; }
    .credits-display { font-size: 0.7rem; white-space: nowrap; }
    .credits-display .coin { font-size: 0.65rem; }

    /* Hide "Become a Host" text on mobile, keep icon only */
    .nav-links .btn[href*="register_host"] { padding: 6px 8px; font-size: 0.75rem; }

    /* Keep Discover hidden on mobile if space is tight */
    .nav-links .btn[href*="discover"] { display: none; }

    /* Hero buttons: stack vertically on small screens */
    .hero .btn-lg { padding: 12px 20px; font-size: 0.9rem; }
}

/* ── GIFT SYSTEM ── */
.gift-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(20,20,40,0.6);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.gift-btn {
    background: rgba(30,30,60,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.2s;
    min-width: 60px;
}
.gift-btn:hover {
    border-color: var(--pink);
    background: rgba(255,77,141,0.1);
    transform: translateY(-2px);
}
.gift-btn .gift-emoji { font-size: 1.5rem; }
.gift-btn .gift-credit {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold, #f59e0b);
    display: flex;
    align-items: center;
    gap: 2px;
}
.gift-btn .gift-credit::before { content: '💰'; font-size: 0.6rem; }
.gift-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.gift-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10,10,24,0.97);
    border-top: 2px solid rgba(124,58,237,0.3);
    padding: 16px;
    z-index: 200;
    max-height: 50vh;
    overflow-y: auto;
    display: none;
    backdrop-filter: blur(10px);
}
.gift-panel.open { display: block; animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.gift-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.gift-panel-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.gift-panel-close {
    background: none; border: none; color: var(--muted);
    font-size: 1.5rem; cursor: pointer; padding: 4px 12px;
}
.gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}
.gift-item {
    background: rgba(20,20,45,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.gift-item:hover {
    border-color: var(--pink);
    background: rgba(255,77,141,0.08);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(255,77,141,0.15);
}
.gift-item:disabled { opacity: 0.4; cursor: not-allowed; }
.gift-item .emoji { font-size: 2rem; display: block; margin-bottom: 4px; }
.gift-item .name { font-size: 0.7rem; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.gift-item .price {
    font-size: 0.75rem;
    font-weight: 800;
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.gift-item .price::before { content: '💰'; font-size: 0.6rem; }

.gift-send-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
}
.gift-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gift-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    z-index: 300;
    pointer-events: none;
    animation: giftPop 1.5s ease-out forwards;
}
@keyframes giftPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

.gift-toggle-btn {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}
