/* ============================================
   CHATMEET ADVANCED DESIGN SYSTEM
   Modern Glassmorphism + Dark Theme Ready
   ============================================ */

/* ----------------------------
   1. CSS VARIABLES & RESET
---------------------------- */
:root {
    /* Core Colors */
    --bg: hsl(250, 20%, 97%);
    --fg: hsl(250, 30%, 12%);
    --card: hsl(0, 0%, 100%);
    --primary: hsl(262, 83%, 58%);
    --secondary: hsl(210, 100%, 56%);
    --accent: hsl(330, 80%, 60%);
    --muted: hsl(250, 15%, 92%);
    --muted-fg: hsl(250, 10%, 45%);
    --border: hsl(250, 15%, 88%);
    --online: hsl(142, 71%, 45%);
    --destructive: hsl(0, 84%, 60%);
    --success: hsl(142, 71%, 45%);
    --warning: hsl(45, 93%, 47%);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(262,83%,58%), hsl(210,100%,56%));
    --gradient-accent: linear-gradient(135deg, hsl(330,80%,60%), hsl(262,83%,58%));
    --gradient-hero: linear-gradient(135deg, hsl(262,83%,25%), hsl(210,100%,30%));
    --gradient-dark: linear-gradient(135deg, #1e1b4b, #1e3a8a);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-card: 0 4px 20px -4px hsl(262 83% 58% / 0.15);
    --shadow-hover: 0 20px 30px -8px hsl(262 83% 58% / 0.2);
    --shadow-glow: 0 0 30px hsl(262 83% 58% / 0.3);
    
    /* Typography */
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Cascadia Code', monospace;
    
    /* Spacing & Radius */
    --radius-sm: 0.5rem;
    --radius: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-index layers */
    --z-header: 100;
    --z-filter: 99;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* Dark mode support (optional, can be toggled) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable auto dark mode */
    /* :root {
        --bg: hsl(250, 20%, 8%);
        --fg: hsl(250, 20%, 95%);
        --card: hsl(250, 20%, 12%);
        --muted: hsl(250, 15%, 18%);
        --muted-fg: hsl(250, 10%, 65%);
        --border: hsl(250, 15%, 22%);
    } */
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* ----------------------------
   2. UTILITY CLASSES
---------------------------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ----------------------------
   3. TYPOGRAPHY
---------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----------------------------
   4. HEADER & NAVIGATION
---------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-base);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    transition: opacity var(--transition-fast);
}
.logo:hover { opacity: 0.8; }

.logo-emoji {
    font-size: 2rem;
    line-height: 1;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    position: relative;
    padding: 0.25rem 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}
.nav-link.active {
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--fg);
    padding: 0.5rem;
}

/* ----------------------------
   5. BUTTONS
---------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-card);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--muted);
    color: var(--fg);
}
.btn-secondary:hover {
    background: var(--border);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ----------------------------
   6. HERO SECTION
---------------------------- */
.hero {
    background: var(--gradient-hero);
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.hero h1 {
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.6s ease 0.1s both;
}

/* ----------------------------
   7. FILTER BAR
---------------------------- */
.filter-bar {
    position: sticky;
    top: 72px;
    z-index: var(--z-filter);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.filter-form input,
.filter-form select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--card);
    color: var(--fg);
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.filter-form input:focus,
.filter-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsl(262 83% 58% / 0.2);
    outline: none;
}

.btn-shuffle {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}
.btn-shuffle:hover {
    background: var(--secondary);
    transform: scale(1.02);
}

/* ----------------------------
   8. PROFILE GRID & CARDS
---------------------------- */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.profile-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    display: block;
}
.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    background: var(--muted);
    overflow: hidden;
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.profile-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.online-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: var(--online);
    border-radius: 50%;
    box-shadow: 0 0 0 3px white;
    animation: pulse 2s infinite;
    z-index: 2;
}

.gender-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    z-index: 2;
}

.card-body {
    padding: 1rem;
    text-align: center;
}
.card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.card-body p {
    color: var(--muted-fg);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.chat-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all var(--transition-base);
}
.chat-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ----------------------------
   9. PROFILE PAGE
---------------------------- */
.profile-page {
    padding: 2rem 0;
}

.profile-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-card);
}

.profile-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.profile-meta {
    font-size: 1.1rem;
    color: var(--muted-fg);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.online-status {
    color: var(--online);
    font-weight: 500;
}

.profile-bio {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-card);
    line-height: 1.8;
}

.suggested-profiles {
    margin-top: 3rem;
}
.suggested-profiles h2 {
    margin-bottom: 1.5rem;
}

/* ----------------------------
   10. BLOG LISTING
---------------------------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.blog-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.blog-image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.blog-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.blog-card:hover .blog-cover {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    align-self: flex-start;
}

.blog-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.blog-title a:hover {
    color: var(--primary);
}

.blog-excerpt {
    color: var(--muted-fg);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--muted-fg);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: auto;
}

.read-more {
    color: var(--primary);
    font-weight: 600;
}
.read-more:hover {
    color: var(--secondary);
}

/* ----------------------------
   11. BLOG POST ADVANCED
---------------------------- */
/* Reading Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
}
.progress-bar {
    height: 4px;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--primary);
}

/* Post Hero */
.post-hero {
    position: relative;
    margin-bottom: 2rem;
}
.post-hero-image {
    height: 50vh;
    min-height: 300px;
    max-height: 500px;
    overflow: hidden;
}
.post-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.7));
}

.post-hero-content {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    color: white;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.post-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.3rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.post-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    max-width: 900px;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 1rem;
    opacity: 0.9;
}
.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Post Layout (Sidebar + Content) */
.post-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin: 3rem auto;
}

.post-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

/* Table of Contents */
.toc-container {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
}
.toc-container h4 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toc ul {
    list-style: none;
    padding-left: 0;
}
.toc li {
    margin-bottom: 0.5rem;
}
.toc-h2 { font-weight: 600; }
.toc-h3 { padding-left: 1rem; font-size: 0.9rem; }
.toc a {
    color: var(--muted-fg);
    transition: color var(--transition-fast);
}
.toc a:hover {
    color: var(--primary);
}

/* Share Box */
.share-box {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.share-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.share-btn:hover { opacity: 0.9; }
.facebook { background: #1877f2; }
.twitter { background: #1da1f2; }
.whatsapp { background: #25d366; }
.copy-link { background: var(--muted-fg); }

/* Post Body */
.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--fg);
}
.post-body h2 {
    font-size: 2rem;
    margin: 2.5rem 0 1rem;
}
.post-body h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}
.post-body p {
    margin-bottom: 1.5rem;
}
.post-body img {
    border-radius: var(--radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-card);
}
.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--muted-fg);
}
.post-body ul, .post-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
}
.post-body li {
    margin-bottom: 0.5rem;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 1.5rem;
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    margin: 3rem 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}
.author-avatar {
    font-size: 3rem;
    background: var(--gradient-primary);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.author-info h4 {
    margin-bottom: 0.5rem;
}
.author-info p {
    color: var(--muted-fg);
}

/* Tags */
.post-tags {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}
.tag {
    background: var(--muted);
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: var(--muted-fg);
    transition: background var(--transition-fast);
}
.tag:hover {
    background: var(--primary);
    color: white;
}

/* Related Posts */
.related-posts {
    background: var(--muted);
    padding: 4rem 0;
    margin-top: 2rem;
}
.related-posts h2 {
    margin-bottom: 2rem;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.related-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
    display: block;
}
.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.related-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.related-content {
    padding: 1.5rem;
}
.related-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
}
.related-content h3 {
    margin: 0.5rem 0;
    font-size: 1.2rem;
}
.related-content time {
    color: var(--muted-fg);
    font-size: 0.9rem;
}

/* ----------------------------
   12. CHAT WINDOW
---------------------------- */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: var(--z-modal);
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.chat-header {
    padding: 1rem;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

.chat-name {
    font-weight: 600;
    flex: 1;
}

.chat-messages {
    height: 350px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg);
}

.msg {
    display: flex;
    gap: 0.5rem;
}
.msg-user {
    justify-content: flex-end;
}
.msg-bot .msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.msg-bubble {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    max-width: 80%;
    word-break: break-word;
}
.user-bubble {
    background: var(--secondary);
    color: white;
    border-bottom-right-radius: 4px;
}
.bot-bubble {
    background: var(--primary);
    color: white;
    border-bottom-left-radius: 4px;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--card);
}
.chat-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--fg);
}
.chat-input input:focus {
    outline: none;
    border-color: var(--primary);
}
.chat-input button {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    border-radius: 50%;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.chat-input button:hover {
    background: var(--secondary);
}

/* ----------------------------
   13. FOOTER
---------------------------- */
.site-footer {
    background: var(--card);
    padding: 3rem 0 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}
.footer-tagline {
    color: var(--muted-fg);
}

.footer-links h4,
.footer-categories h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}
.footer-links a,
.footer-categories a {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--muted-fg);
    transition: color var(--transition-fast);
}
.footer-links a:hover,
.footer-categories a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--muted-fg);
}

/* ----------------------------
   14. ADMIN PANEL
---------------------------- */
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-container {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-card);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 260px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
}
.admin-content {
    flex: 1;
    padding: 2rem;
    background: var(--bg);
}

.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
    transition: border-color var(--transition-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px hsl(262 83% 58% / 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.stat-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: var(--muted);
    font-weight: 600;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.alert.error {
    background: #fee2e2;
    color: #991b1b;
}
.alert.success {
    background: #dcfce7;
    color: #166534;
}

/* ----------------------------
   15. MISC COMPONENTS
---------------------------- */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}
.category-pill {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}
.category-pill:hover,
.category-pill.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.online-counter {
    margin: 1.5rem auto;
    text-align: center;
    font-size: 1.1rem;
}
.pulse-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--online);
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
    vertical-align: middle;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--card);
    border-radius: var(--radius);
}
.no-results p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.ad-unit {
    margin: 2rem 0;
    text-align: center;
    overflow: hidden;
}

.announcement-bar {
    background: var(--gradient-accent);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* ----------------------------
   16. ANIMATIONS
---------------------------- */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--online); }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ----------------------------
   17. RESPONSIVE DESIGN
---------------------------- */
@media (max-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .post-sidebar {
        position: static;
        order: 2;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
    }
    .main-nav.active {
        display: flex;
    }
    
    .profiles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .filter-form {
        flex-wrap: wrap;
    }
    .filter-form input,
    .filter-form select {
        flex: 1 1 calc(50% - 0.5rem);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    .profile-avatar {
        width: 150px;
        height: 150px;
    }
    
    .post-hero-image {
        height: 40vh;
    }
    .post-title {
        font-size: 2rem;
    }
    .post-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    .author-avatar {
        margin: 0 auto;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .profiles-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-form {
        flex-direction: column;
    }
    .filter-form input,
    .filter-form select {
        width: 100%;
    }
    
    .chat-window {
        width: calc(100vw - 20px);
        bottom: 10px;
        right: 10px;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    .share-btn {
        width: 100%;
    }
}

/* ----------------------------
   18. PRINT STYLES
---------------------------- */
@media print {
    .site-header,
    .filter-bar,
    .chat-window,
    .site-footer,
    .progress-container,
    .share-box,
    .ad-unit {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .post-body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
    }
}




/* Blog Index Layout */
.blog-index {
    margin: 2rem auto;
}
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
}
.blog-main {
    min-width: 0;
}
.section-title {
    font-size: 1.8rem;
    margin: 2rem 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-label {
    color: var(--muted-fg);
    margin-right: 0.5rem;
}

/* Featured Post */
.featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-base);
}
.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.featured-content h3 {
    font-size: 1.8rem;
    margin: 0.5rem 0 1rem;
}
.featured-excerpt {
    color: var(--muted-fg);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Horizontal Scroll Sections */
.horizontal-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}
.horizontal-card {
    flex: 0 0 280px;
}
.horizontal-card .blog-image-link {
    aspect-ratio: 16/9;
}
.horizontal-card .excerpt-small {
    font-size: 0.9rem;
    color: var(--muted-fg);
    margin: 0.5rem 0;
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}
.sidebar-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
}
.expert-box {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
}
.expert-box h3 {
    color: white;
}
.expert-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.expert-name {
    font-style: italic;
    opacity: 0.9;
}
.expert-box .btn-outline {
    border-color: white;
    color: white;
    margin-top: 1rem;
}
.popular-posts ul {
    list-style: none;
    padding: 0;
}
.popular-posts li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.popular-posts li:last-child {
    border-bottom: none;
}
.popular-posts a {
    font-weight: 500;
    color: var(--fg);
}
.popular-posts .post-date {
    font-size: 0.8rem;
    color: var(--muted-fg);
}
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}
.newsletter-form input {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    .blog-sidebar {
        position: static;
    }
    .featured-card {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .horizontal-card {
        flex: 0 0 240px;
    }
}



/* ============================================
   ULTRA‑COMPACT MOBILE CHAT WINDOW
   ============================================ */

@media (max-width: 640px) {
    .chat-window {
        bottom: 5px;
        right: 5px;
        left: 5px;
        width: auto;
        max-width: none;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }

    /* Even smaller header */
    .chat-header {
        padding: 0.4rem 0.6rem;
        gap: 0.3rem;
    }
    .chat-avatar {
        width: 28px;
        height: 28px;
    }
    .chat-name {
        font-size: 0.85rem;
        font-weight: 600;
    }
    .online-indicator {
        font-size: 0.7rem;
    }

    /* Reduce message area drastically */
    .chat-messages {
        height: 140px;          /* short enough to see keyboard */
        max-height: 25vh;
        padding: 0.5rem;
    }

    /* Compact message bubbles */
    .msg-bubble {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }
    .msg-avatar {
        width: 24px;
        height: 24px;
    }

    /* Small input area */
    .chat-input {
        padding: 0.4rem;
        gap: 0.3rem;
    }
    .chat-input input {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
        border-radius: 20px;
    }
    .chat-input button {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    /* Minimize/close buttons larger touch target */
    .chat-header button {
        padding: 6px;
        min-width: 32px;
        min-height: 32px;
        font-size: 1.1rem;
    }

    /* When keyboard is open, make chat even smaller */
    @media (max-height: 450px) {
        .chat-messages {
            height: 100px;
            max-height: 20vh;
        }
        .chat-header {
            padding: 0.3rem 0.5rem;
        }
        .chat-input {
            padding: 0.3rem;
        }
    }
}

/* Stacking multiple chats on mobile – offset each */
@media (max-width: 640px) {
    .chat-window:nth-child(2) {
        bottom: 60px;
        z-index: 999;
    }
    .chat-window:nth-child(3) {
        bottom: 115px;
        z-index: 998;
    }
}


/* ============================================
   ULTRA‑COMPACT MOBILE CHAT WINDOW (Narrower)
   ============================================ */

@media (max-width: 640px) {
    .chat-window {
        bottom: 10px;
        right: 10px;
        left: auto;                /* Don't stretch full width */
        width: 280px;              /* Fixed narrower width */
        max-width: 85vw;           /* Fallback for very small screens */
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }

    /* Even smaller header */
    .chat-header {
        padding: 0.4rem 0.6rem;
        gap: 0.3rem;
    }
    .chat-avatar {
        width: 28px;
        height: 28px;
    }
    .chat-name {
        font-size: 0.8rem;
        font-weight: 600;
    }
    .online-indicator {
        font-size: 0.65rem;
    }

    /* Reduce message area drastically */
    .chat-messages {
        height: 140px;
        max-height: 25vh;
        padding: 0.5rem;
    }

    /* Compact message bubbles */
    .msg-bubble {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 12px;
    }
    .msg-avatar {
        width: 24px;
        height: 24px;
    }

    /* Small input area */
    .chat-input {
        padding: 0.4rem;
        gap: 0.3rem;
    }
    .chat-input input {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }
    .chat-input button {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* Minimize/close buttons larger touch target */
    .chat-header button {
        padding: 5px;
        min-width: 30px;
        min-height: 30px;
        font-size: 1rem;
    }

    /* When keyboard is open, make chat even smaller */
    @media (max-height: 450px) {
        .chat-messages {
            height: 100px;
        }
        .chat-window {
            width: 260px;
        }
    }
}

/* Stack multiple chats with offset */
@media (max-width: 640px) {
    .chat-window:nth-child(2) {
        bottom: 60px;
        right: 10px;
        z-index: 999;
    }
    .chat-window:nth-child(3) {
        bottom: 115px;
        right: 10px;
        z-index: 998;
    }
}






/* ============================================
   MOBILE MULTI‑CHAT STACKING (Minimized Headers)
   ============================================ */

@media (max-width: 640px) {
    /* Base chat window (expanded) */
    .chat-window {
        width: 280px;
        max-width: 85vw;
        bottom: 10px;
        right: 10px;
        left: auto;
        transition: all 0.2s ease;
    }

    /* When minimized – only show header bar */
    .chat-window .chat-messages[style*="display: none"],
    .chat-window .chat-input[style*="display: none"] {
        /* This selector targets when messages are hidden */
    }

    /* Style for minimized state (header only) */
    .chat-window.minimized {
        height: auto !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    .chat-window.minimized .chat-messages,
    .chat-window.minimized .chat-input {
        display: none !important;
    }

    /* Stack minimized chats vertically */
    .chat-window:nth-child(2) {
        bottom: 70px;
        z-index: 999;
    }
    .chat-window:nth-child(3) {
        bottom: 130px;
        z-index: 998;
    }

    /* When multiple are expanded, offset them slightly */
    .chat-window.expanded ~ .chat-window.expanded {
        margin-bottom: 5px;
    }
}






.start-chat-btn,
.btn-primary,
.chat-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 10;
}

/* Ensure no overlay blocks the button */
.profile-info,
.profile-header,
.profile-page {
    position: relative;
    z-index: 1;
}


/* ===== ENHANCED MOBILE STYLES FOR BLOG POST ===== */
@media (max-width: 768px) {
    /* Hero adjustments */
    .post-hero-image {
        height: 35vh;
        min-height: 220px;
    }
    .post-hero-content {
        bottom: 1.5rem;
        padding: 0 1rem;
    }
    .post-category {
        font-size: 0.7rem;
        padding: 0.2rem 0.9rem;
        margin-bottom: 0.75rem;
    }
    .post-title {
        font-size: 1.8rem;
        margin-bottom: 0.75rem;
        line-height: 1.3;
    }
    .post-meta {
        gap: 1rem;
        font-size: 0.85rem;
    }

    /* Layout – single column, full width */
    .post-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem auto;
        padding: 0 1rem;
    }

    /* Sidebar – move below content, not sticky */
    .post-sidebar {
        position: static;
        order: 2;
    }

    /* Table of Contents – compact */
    .toc-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    .toc-container h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    .toc li {
        margin-bottom: 0.4rem;
    }
    .toc a {
        font-size: 0.9rem;
    }

    /* Share box – horizontal buttons if possible, else stack */
    .share-box {
        padding: 1rem;
    }
    .share-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .share-btn {
        flex: 1 0 calc(50% - 0.5rem);
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

    /* Post body – readable font size and spacing */
    .post-body {
        font-size: 1rem;
        line-height: 1.7;
    }
    .post-body h2 {
        font-size: 1.6rem;
        margin: 2rem 0 1rem;
    }
    .post-body h3 {
        font-size: 1.3rem;
        margin: 1.5rem 0 0.75rem;
    }
    .post-body p {
        margin-bottom: 1.2rem;
    }
    .post-body img {
        margin: 1.5rem 0;
        border-radius: 0.75rem;
    }
    .post-body blockquote {
        padding-left: 1rem;
        margin: 1rem 0;
    }
    .post-body ul, 
    .post-body ol {
        margin-left: 1.2rem;
    }

    /* Author box – stack vertically */
    .author-box {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        margin: 2rem 0;
    }
    .author-avatar {
        margin: 0 auto 1rem;
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
    }

    /* Tags – smaller */
    .post-tags {
        gap: 0.5rem;
        margin: 1.5rem 0;
    }
    .tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.8rem;
    }

    /* Related posts – single column, larger touch targets */
    .related-posts {
        padding: 2.5rem 0;
    }
    .related-posts h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    .related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .related-card {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
    .related-card img {
        width: 100px;
        height: 100px;
        object-fit: cover;
        border-radius: 0.5rem 0 0 0.5rem;
    }
    .related-content {
        padding: 0.75rem 1rem;
        flex: 1;
    }
    .related-content h3 {
        font-size: 1rem;
        margin: 0.25rem 0;
    }
    .related-category {
        font-size: 0.7rem;
    }
    .related-content time {
        font-size: 0.75rem;
    }
}

/* Extra small devices (phones < 480px) */
@media (max-width: 480px) {
    .post-title {
        font-size: 1.6rem;
    }
    .post-meta {
        flex-direction: column;
        gap: 0.4rem;
    }
    .share-btn {
        flex: 1 0 100%;
    }
    .related-card {
        flex-direction: column;
    }
    .related-card img {
        width: 100%;
        height: 160px;
        border-radius: 0.5rem 0.5rem 0 0;
    }
}





@media (max-width: 640px) {
    .chat-window {
        bottom: 90px !important;  /* Adjust this value based on your ad height */
        /* or use margin-bottom */
        margin-bottom: 10px;
    }
    
    /* If you have multiple stacked chats, offset each one */
    .chat-window:nth-child(2) {
        bottom: 150px !important; /* base + ~60px */
    }
    .chat-window:nth-child(3) {
        bottom: 210px !important;
    }
}



.chat-ad-container {
    background: var(--card, #fff);
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border, #ddd);
    padding: 4px 0;
}


.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    z-index: 999;
}
.chat-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
}
.chat-window.centered {
    position: relative;
    width: 380px;
    max-width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.chat-ad-external {
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    min-width: 300px;
    min-height: 250px;
}
@media (max-width: 640px) {
    .chat-window.centered { width: 320px; }
    .chat-ad-external { min-width: 280px; }
}






/* ===== COMPACT CENTERED CHAT WINDOW ===== */
.chat-window.centered {
    position: relative;
    width: 360px;                /* slightly narrower */
    max-width: 90vw;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 60vh;            /* limit overall height */
    display: flex;
    flex-direction: column;
}

.chat-window.centered .chat-header {
    padding: 0.5rem 0.8rem;      /* reduce padding */
    flex-shrink: 0;
}

.chat-window.centered .chat-avatar {
    width: 32px;
    height: 32px;
}

.chat-window.centered .chat-name {
    font-size: 0.95rem;
}

.chat-window.centered .chat-messages {
    flex: 1;
    min-height: 0;               /* allow flex shrinking */
    max-height: 35vh;            /* shorter message area */
    padding: 0.6rem;
    overflow-y: auto;
}

.chat-window.centered .chat-input {
    padding: 0.5rem;
    flex-shrink: 0;
}

.chat-window.centered .chat-input input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.chat-window.centered .chat-input button {
    width: 36px;
    height: 36px;
}

/* External ad – keep it visible */
.chat-ad-external {
    margin-top: 12px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    min-width: 300px;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile further reduction */
@media (max-width: 640px) {
    .chat-window.centered {
        width: 300px;
        max-height: 50vh;
    }
    .chat-window.centered .chat-messages {
        max-height: 25vh;
    }
    .chat-ad-external {
        min-width: 260px;
        min-height: 250px;
    }
}




/* Inline Chat Box */
.inline-chat-container {
    margin-top: 20px;
    max-width: 400px;
    width: 100%;
}

.inline-chat-box {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 15px;
}

.inline-chat-box .chat-header {
    padding: 0.6rem 1rem;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-chat-box .chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
}

.inline-chat-box .chat-name {
    font-weight: 600;
    flex: 1;
    font-size: 0.95rem;
}

.inline-chat-box .chat-messages {
    height: 250px;
    max-height: 40vh;
    overflow-y: auto;
    padding: 0.8rem;
    background: var(--bg);
}

.inline-chat-box .chat-input {
    display: flex;
    padding: 0.6rem;
    border-top: 1px solid var(--border);
    background: var(--card);
}

.inline-chat-box .chat-input input {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    font-size: 0.9rem;
}

.inline-chat-box .chat-input button {
    background: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-left: 0.5rem;
    cursor: pointer;
}

/* Inline Ad below chat */
.inline-chat-ad {
    background: var(--card);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-card);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    max-width: 300px;
    margin: 0 auto;
}
/* ===== COMPACT INLINE CHAT BOX - MOBILE OPTIMIZATION ===== */
@media (max-width: 640px) {
    /* Container spacing */
    .inline-chat-container {
        margin-top: 15px;
        max-width: 100%;
    }

    /* Chat box – reduced height */
    .inline-chat-box {
        margin-bottom: 8px;                /* reduce gap between chat and ad */
    }

    .inline-chat-box .chat-header {
        padding: 0.4rem 0.8rem;
    }

    .inline-chat-box .chat-avatar {
        width: 28px;
        height: 28px;
    }

    .inline-chat-box .chat-name {
        font-size: 0.85rem;
    }

    .inline-chat-box .chat-messages {
        height: 180px;                     /* shorter message area for mobile */
        max-height: 30vh;
        padding: 0.5rem;
    }

    .inline-chat-box .chat-input {
        padding: 0.4rem;
    }

    .inline-chat-box .chat-input input {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .inline-chat-box .chat-input button {
        width: 32px;
        height: 32px;
    }

    /* Message bubbles – compact */
    .inline-chat-box .msg-bubble {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    /* Ad container – reduced top margin */
    .inline-chat-ad {
        margin-top: 0;
        padding: 5px;
        min-height: 250px;                 /* keep ad height */
    }
}

/* For very small screens (height < 500px) make chat even smaller */
@media (max-width: 640px) and (max-height: 500px) {
    .inline-chat-box .chat-messages {
        height: 140px;
        max-height: 25vh;
    }
}