/* ===== CSS Variables - Vibrant Purple/Pink Theme ===== */
:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --secondary: #EC4899;
    --secondary-light: #F472B6;
    --accent: #06B6D4;
    --success: #10B981;

    --bg-page: #0F0F1A;
    --bg-phone: #18181B;
    --bg-chat: #1E1E24;
    --bg-bubble: #27272A;
    --bg-bubble-incoming: linear-gradient(135deg, #3B3B45, #2D2D35);
    --bg-bubble-outgoing: linear-gradient(135deg, var(--primary), var(--secondary));

    --text-white: #FFFFFF;
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(139, 92, 246, 0.5);

    --shadow-phone: 0 25px 80px rgba(139, 92, 246, 0.15), 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-button: 0 10px 30px rgba(139, 92, 246, 0.3);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* ===== Mesh Gradient Background ===== */
.mesh-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(139, 92, 246, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(236, 72, 153, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
    animation: meshMove 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes meshMove {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.1) rotate(2deg);
    }
}

.noise-overlay {
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ===== Phone Frame ===== */
.phone-frame {
    position: relative;
    width: 100%;
    max-width: 390px;
    min-height: 700px;
    background: var(--bg-phone);
    border-radius: 45px;
    border: 4px solid #2A2A30;
    box-shadow: var(--shadow-phone);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Status Bar ===== */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-icons {
    display: flex;
    gap: 6px;
    font-size: 0.75rem;
}

/* ===== App Header ===== */
.app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.back-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-bubble);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

.back-btn:hover {
    background: var(--primary);
}

.app-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

.app-icon {
    font-size: 1.4rem;
}

.notification-badge {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.badge-count {
    font-size: 0.85rem;
    font-weight: 700;
}

/* ===== Screen Container ===== */
.screen-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: screenSlide 0.4s ease;
}

.screen.active {
    display: flex;
}

@keyframes screenSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Chat Container ===== */
.chat-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.message-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--primary);
}

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

.messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 80%;
}

/* ===== Chat Bubbles ===== */
.bubble {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: bubbleIn 0.4s ease backwards;
}

.bubble.animate-in {
    animation-delay: var(--delay, 0s);
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bubble.incoming {
    background: var(--bg-bubble-incoming);
    border-bottom-left-radius: 6px;
    color: var(--text-primary);
}

.bubble.outgoing {
    background: var(--bg-bubble-outgoing);
    border-bottom-right-radius: 6px;
    margin-left: auto;
    color: white;
}

.bubble strong {
    color: var(--secondary-light);
}

/* ===== Action Area ===== */
.action-area {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.action-area.final {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ===== Reply Button ===== */
.reply-button {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-button);
}

.reply-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.reply-button.pulse {
    animation: buttonPulse 2s ease infinite;
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow: var(--shadow-button);
    }

    50% {
        box-shadow: 0 15px 50px rgba(139, 92, 246, 0.5);
    }
}

/* ===== Quick Replies ===== */
.quick-replies {
    display: flex;
    gap: 12px;
}

.quick-reply {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 15px;
    background: var(--bg-bubble);
    border: 2px solid var(--border-subtle);
    border-radius: 20px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.quick-reply:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.quick-reply.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.1));
    border-color: var(--primary);
    transform: scale(0.98);
}

.quick-reply .emoji {
    font-size: 2.5rem;
}

.quick-reply span:last-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Age Pills ===== */
.age-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.age-pill {
    padding: 14px 24px;
    background: var(--bg-bubble);
    border: 2px solid var(--border-subtle);
    border-radius: 50px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.age-pill:hover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.age-pill.selected {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
}

/* ===== Notifications Stack ===== */
.notifications-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 15px;
    margin-bottom: 15px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--bg-bubble);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    animation: notifSlide 0.5s ease backwards;
    animation-delay: var(--delay, 0s);
}

@keyframes notifSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary);
}

.notif-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Live Indicator ===== */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--success);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: livePulse 1.5s ease infinite;
}

@keyframes livePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* ===== Final CTA ===== */
.cta-final {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    border-radius: 18px;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    animation: ctaGlow 2s ease infinite;
}

@keyframes ctaGlow {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    }

    50% {
        box-shadow: 0 15px 50px rgba(16, 185, 129, 0.5);
    }
}

.cta-final:hover {
    transform: translateY(-2px) scale(1.01);
}

.cta-emoji {
    font-size: 1.4rem;
}

.fine-print {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 12px 10px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--border-subtle);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover {
    transform: scale(1.1);
}

.nav-icon {
    font-size: 1.4rem;
    opacity: 0.5;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.nav-item.active .nav-label {
    color: var(--primary-light);
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    background: var(--secondary);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ===== Page Footer ===== */
.page-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Responsive ===== */
@media (max-width: 420px) {
    body {
        padding: 0;
    }

    .phone-frame {
        border-radius: 0;
        border: none;
        min-height: 100vh;
        max-width: 100%;
    }

    .page-footer {
        display: none;
    }
}

@media (min-height: 800px) {
    .phone-frame {
        min-height: 750px;
    }
}