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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dim: rgba(99, 102, 241, 0.1);
    --text-dark: #0f172a;
    --text-gray: #475569;
    --bg-light: #f8fafc;
    --border-soft: rgba(226, 232, 240, 0.8);

    /* Instagram Theme Constants */
    --ig-blue: #0095f6;
    --ig-grey: #8e8e8e;
    --ig-light-grey: #efefef;
    --ig-white: #ffffff;
    --ig-black: #262626;
    --ig-border: #dbdbdb;
    --ig-input-bg: #f2f2f2;
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --ig-msg-gradient: linear-gradient(45deg, #12c2e9, #c471ed, #f64f59);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #fff;
    color: var(--text-dark);
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 10vw, 3.75rem) !important;
    /* Lower min for small phones */
    line-height: 1.1;
    word-break: break-word;
}

h2 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.5rem, 8vw, 3rem) !important;
    word-break: break-word;
}

h3,
h4 {
    font-family: 'Outfit', sans-serif;
    word-break: break-word;
}

.soft-shadow {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.glow-effect {
    position: relative;
}

.glow-effect::after {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--primary-dim) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* --- Navigation --- */

.nav-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-soft);
}

/* --- Animations --- */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.msg-anim {
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.8s;
}

.delay-2 {
    animation-delay: 2s;
}

.delay-3 {
    animation-delay: 3.2s;
}

@keyframes subtle-float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: subtle-float 5s ease-in-out infinite;
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Instagram Chat Demo Styles (Faithful to Reference) --- */

.chat-container {
    width: 100%;
    max-width: 375px;
    height: 620px;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    text-align: left;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-header {
    padding: 18px 24px;
    border-bottom: 0.5px solid #efefef;
    background: #fff;
}

.avatar-wrapper {
    padding: 2.5px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-radius: 50%;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #fafafa;
}

.chat-messages {
    flex: 1;
    padding: 20px 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Ensure messages are aligned to sides */
.message-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.message {
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 15px;
    max-width: 85%;
    line-height: 1.4;
}

.message.bot {
    background: #efefef;
    color: #262626;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: linear-gradient(45deg, #0095f6, #c471ed, #f64f59);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.seen-status {
    font-size: 12px;
    color: #8e8e8e;
    margin-top: 2px;
    align-self: flex-end;
    padding-right: 4px;
    display: none;
}

.typing-indicator {
    display: none;
    align-self: flex-start;
    background: #efefef;
    padding: 10px 16px;
    border-radius: 20px;
    gap: 4px;
    margin-left: 20px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #8e8e8e;
    border-radius: 50%;
    animation: ig-bounce 1.3s infinite;
}

@keyframes ig-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #fff;
    color: var(--text-dark);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    width: 100%;
}

/* --- Responsive Adjustments --- */

@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        max-width: 100% !important;
        height: auto;
        aspect-ratio: 9/16;
        max-height: 600px;
        border-radius: 20px;
    }

    .hero-gradient {
        padding-top: 3rem;
        padding-bottom: 2rem;
    }

    h1 {
        font-size: 2rem !important;
        /* More aggressive for mobile */
        line-height: 1.15 !important;
    }

    .glass-card {
        padding: 1.5rem !important;
    }

    section {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
}

@media (max-width: 380px) {
    h1 {
        font-size: 1.75rem !important;
    }

    .btn-primary {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 14px 16px;
    }

    .message {
        font-size: 14px;
        padding: 10px 16px;
    }

    .avatar {
        width: 36px;
        height: 36px;
    }
}

.ig-suggestions {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 20px;
    border-top: 0.5px solid #efefef;
    scrollbar-width: none;
}

.ig-suggestions::-webkit-scrollbar {
    display: none;
}

.ig-suggestions button {
    flex: 0 0 auto;
    border: 1px solid #dbdbdb;
    background: #fff;
    color: #262626;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.chat-footer {
    padding: 16px 20px;
    background: #fff;
}

.chat-input-container {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 30px;
    padding: 6px 16px;
    border: 1px solid #dbdbdb;
}

.chat-input {
    flex: 1;
    padding: 10px 4px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #262626;
}

.input-icons {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #262626;
}

.send-link {
    color: #0095f6;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}

/* --- Hero & Sections --- */

.hero-gradient {
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent),
        radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.03), transparent);
}

.btn-primary {
    background: var(--primary);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}