/* cam-chatbot.css - Minimalist Modern VTON UI (2026 Edition) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
    --cam-navy: #1e293b;
    --cam-navy-hover: #0f172a;
    --cam-teal: #0f766e;
    --cam-beige: #fef6e4;
    --cam-beige-hover: #f3e5cd;
    --cam-purple: #8b5cf6;
    --cam-bg-soft: #f8fafc;
    --cam-border: #e2e8f0;
    --cam-text-dark: #1e293b;
    --cam-text-light: #64748b;
    --cam-shopee: #ee4d2d;
    --cam-lazada: #0f146d;
}

.cam-chatbot-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    min-height: 600px;
    max-height: 900px;
    max-width: 1400px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    font-family: 'Noto Sans Thai', sans-serif;
    border: 1px solid var(--cam-border);
}

@media (min-width: 992px) {
    .cam-chatbot-wrapper { flex-direction: row; }
}

/* --- Left Column: Settings --- */
.cam-chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--cam-bg-soft);
    border-right: 1px solid var(--cam-border);
    max-width: 100%;
}

@media (min-width: 992px) {
    .cam-chat-section { max-width: 380px; }
}

.cam-chat-header {
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid var(--cam-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cam-chat-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cam-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.cam-chat-header-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--cam-text-dark); }
.cam-chat-header-status { margin: 0; font-size: 13px; color: var(--cam-teal); }

.cam-chat-close-btn {
    width: 36px; height: 36px; border-radius: 50%; background: #ffffff;
    border: 1px solid var(--cam-border); color: var(--cam-text-light);
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: all 0.2s;
}
.cam-chat-close-btn:hover { background: #f1f5f9; color: var(--cam-text-dark); }

.cam-vton-sidebar-content {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Modern Cards --- */
.cam-modern-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--cam-border);
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.cam-modern-card-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--cam-text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cam-modern-card-header img { width: 18px; height: 18px; object-fit: contain; }

.cam-vton-warning-text {
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #b45309;
    line-height: 1.5;
}

.cam-modern-preview-wrap {
    text-align: center;
    margin-bottom: 15px;
}
.cam-modern-preview-wrap img {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 12px;
    border: 1px dashed var(--cam-text-light);
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.cam-empty-preview {
    width: 100%; max-width: 200px; aspect-ratio: 4/5;
    background: var(--cam-bg-soft); border-radius: 12px;
    border: 2px dashed #94a3b8; display: flex; align-items: center; justify-content: center;
    color: #94a3b8; margin: 0 auto; font-size: 13px; text-align: center; padding: 10px;
}

/* --- Buttons --- */
.cam-modern-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.cam-btn-navy { background: var(--cam-navy); color: #fff; }
.cam-btn-navy:hover { background: var(--cam-navy-hover); box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2); }

.cam-btn-beige { background: var(--cam-beige); color: var(--cam-text-dark); border: 1px solid #f3e5cd; }
.cam-btn-beige:hover { background: var(--cam-beige-hover); }

.cam-btn-purple { background: var(--cam-purple); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2); }
.cam-btn-purple:hover { background: #7c3aed; box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3); }

.cam-btn-outline-blue { background: #f0f6ff; color: #2563eb; border: 1px solid #dbeafe; font-size: 13px; padding: 6px 12px; width: auto; border-radius: 8px; }
.cam-btn-outline-blue:hover { background: #dbeafe; }

.cam-btn-generate-hero {
    background: var(--cam-navy);
    color: #fff;
    font-size: 16px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(30, 41, 59, 0.2);
}
.cam-btn-generate-hero:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(30, 41, 59, 0.3); }

.cam-btn-shopee-hero { background: var(--cam-shopee); color: #fff; font-size: 15px; border-radius: 8px; }
.cam-btn-lazada-hero { background: var(--cam-lazada); color: #fff; font-size: 15px; border-radius: 8px; }

.cam-vton-buy-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}
.cam-vton-buy-actions a {
    flex: 1;
    text-align: center;
}

/* --- Quota Box --- */
.cam-quota-card { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.cam-quota-label { font-size: 13px; color: var(--cam-text-light); margin-bottom: 4px; }
.cam-quota-value { font-size: 24px; font-weight: 700; color: var(--cam-text-dark); }
.cam-quota-value span:last-child { font-size: 13px; font-weight: normal; color: var(--cam-text-light); }

/* --- Right Area: Workspace --- */
.cam-products-section {
    flex: 2;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.cam-tryon-workspace-modern {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* AI Result Container */
.cam-vton-result-hero-container {
    width: 100%;
    aspect-ratio: 4/5;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--cam-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.cam-vton-placeholder { text-align: center; color: #94a3b8; }
.cam-vton-placeholder i { font-size: 48px; color: #cbd5e1; margin-bottom: 12px; display: block; }

.cam-mobile-top-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.cam-mobile-card {
    background: #ffffff;
    border: 1px solid var(--cam-border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
}
.cam-mobile-card-title { font-size: 12px; font-weight: 600; margin-bottom: 10px; color: var(--cam-text-dark); display: flex; align-items: center; justify-content: center; gap: 4px; }
.cam-mobile-card img.preview { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; margin-bottom: 10px; border: 1px dashed var(--cam-text-light); }
.cam-mobile-card .cam-empty-preview { width: 100%; aspect-ratio: 4/5; background: var(--cam-bg-soft); border-radius: 8px; border: 1px dashed #94a3b8; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 11px; margin-bottom: 10px; }

.cam-mobile-tryon-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--cam-border);
    font-size: 13px;
    font-weight: 600;
}
.cam-footer-quota { color: var(--cam-text-dark); }
.cam-footer-wardrobe { color: var(--cam-text-dark); text-decoration: none; display: flex; align-items: center; gap: 4px; }

/* Wardrobe Grid */
.cam-wardrobe-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--cam-border);
    display: flex; justify-content: space-between; align-items: center;
}
.cam-wardrobe-header h3 { margin: 0; font-size: 18px; color: var(--cam-text-dark); display: flex; align-items: center; gap: 8px; }

.cam-wardrobe-grid {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.cam-wardrobe-item {
    background: white; border-radius: 16px; overflow: hidden;
    border: 1px solid var(--cam-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.2s; position: relative;
}
.cam-wardrobe-item:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.cam-wardrobe-item-img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; }
.cam-wardrobe-item-actions { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.cam-btn-fullview { background: var(--cam-bg-soft); color: var(--cam-text-dark); font-size: 13px; font-weight: 600; padding: 10px; border-radius: 8px; text-align: center; border: none; cursor: pointer; transition: all 0.2s; }
.cam-btn-fullview:hover { background: #e2e8f0; }
.cam-btn-buy { background: var(--cam-teal); color: #fff; font-size: 13px; font-weight: 600; padding: 10px; border-radius: 8px; text-align: center; text-decoration: none; transition: all 0.2s; display: block; }
.cam-btn-buy:hover { background: #115e59; }
.cam-wardrobe-item-delete { position: absolute; top: 8px; right: 8px; background: #ef4444; color: white; border: none; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: all 0.2s; }
.cam-wardrobe-item-delete:hover { transform: scale(1.1); }

/* Desktop/Mobile Visibility Utilities */
@media (min-width: 992px) {
    .desktop-hidden { display: none !important; }
}
@media (max-width: 991px) {
    .cam-mobile-hidden { display: none !important; }
    .cam-tryon-workspace-modern { 
        display: flex;
        flex-direction: column;
        height: calc(100dvh - 55px); /* Header height ~55px */
        padding: 15px 15px 0 15px; 
        box-sizing: border-box;
    }
    
    .cam-vton-result-hero-container {
        flex: 1;
        min-height: 0; /* Let it shrink */
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    #cam-vton-result-img {
        object-fit: contain !important;
        max-height: 100%;
    }
    
    .cam-mobile-tryon-footer {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 12px 15px;
        margin: auto -15px 0 -15px; /* Offset parent padding */
        border-top: 1px solid var(--cam-border);
        box-shadow: 0 -4px 15px rgba(0,0,0,0.03);
        z-index: 10;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .cam-chat-header { position: sticky; top: 0; z-index: 10; }
    /* Hide footer on mobile chatbot page */
    footer, .site-footer, #colophon, .footer-wrap {
        display: none !important;
    }
    
    html, body {
        overflow: hidden !important;
        background: #fff !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
    }

    .cam-chatbot-wrapper {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        z-index: 999999 !important;
        max-width: 100% !important;
        display: flex;
        flex-direction: column;
        background: #fff;
    }
    
    /* Make chat section take full height */
    .cam-chat-section {
        flex: 1;
        max-height: none;
        overflow: hidden;
    }
    
    /* Completely hide products section on mobile ONLY for chatbot page */
    .cam-chatbot-page .cam-products-section {
        display: none !important;
    }
    
    .cam-vton-buy-actions { display: flex; gap: 10px; }
    .cam-vton-buy-actions a { flex: 1; padding: 12px 8px; font-size: 13px; }
    .cam-vton-result-hero-container { border-radius: 12px; }
    .cam-wardrobe-grid { padding: 20px; grid-template-columns: repeat(2, 1fr); gap: 15px; }
    
    /* Fix crushed cards in mobile carousel */
    .cam-mobile-carousel .cam-frontend-card {
        min-width: 220px;
        max-width: 220px;
        flex-shrink: 0;
        scroll-snap-align: start;
        margin-bottom: 0;
    }
}

/* Image Modal */
.cam-modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(8px);
    z-index: 999999; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.cam-modal-backdrop.active { opacity: 1; visibility: visible; }
.cam-modal-content {
    max-width: 90%; max-height: 90vh; border-radius: 16px; overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); position: relative;
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cam-modal-backdrop.active .cam-modal-content { transform: scale(1); }
.cam-modal-img { display: block; max-width: 100%; max-height: 90vh; object-fit: contain; }
.cam-modal-close {
    position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
    background: rgba(0,0,0,0.5); color: white; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    backdrop-filter: blur(4px); transition: background 0.2s;
}
.cam-modal-close:hover { background: rgba(0,0,0,0.8); }
.cam-meta-text { font-size: 13px; color: var(--cam-text-light); }

/* AI Stylist Chat UI Styles */
.cam-chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; background: #fff; }
.cam-msg-bubble { padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; color: #1e293b; background: #f1f5f9; position: relative; max-width: 85%; width: max-content; }
.cam-msg-user { align-self: flex-end; background: var(--cam-primary, #8b5cf6) !important; color: #fff; border-bottom-right-radius: 4px; }
.cam-msg-ai { align-self: flex-start; background: #f1f5f9; border-bottom-left-radius: 4px; border: 1px solid #e2e8f0; }
.cam-chat-input-area { padding: 15px 20px; border-top: 1px solid #e2e8f0; background: #fff; }
.cam-chat-input-wrapper { display: flex; gap: 10px; align-items: center; background: #f8fafc !important; border: 1px solid #e2e8f0 !important; border-radius: 24px !important; padding: 6px 6px 6px 20px !important; }
.cam-chat-input { flex: 1; border: none !important; background: transparent !important; padding: 10px 0 !important; outline: none !important; font-size: 16px !important; font-family: inherit; color: #1e293b !important; box-shadow: none !important; }
.cam-chat-send-btn { width: 38px !important; height: 38px !important; border-radius: 50% !important; background: var(--cam-primary, #8b5cf6) !important; color: #fff !important; border: none !important; display: flex !important; align-items: center !important; justify-content: center !important; cursor: pointer; transition: transform 0.2s; padding: 0 !important; flex-shrink: 0; box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3) !important; }
.cam-chat-send-btn:hover { transform: scale(1.05); }
.cam-chat-send-btn svg { width: 16px; height: 16px; }
.cam-product-suggestion { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; margin-top: 10px; background: #fff; display: flex; gap: 10px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.cam-product-suggestion:hover { border-color: var(--cam-primary, #8b5cf6); }
.cam-product-suggestion img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.cam-product-suggestion-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cam-product-suggestion-title { font-size: 13px; font-weight: 500; color: #1e293b; margin: 0 0 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.cam-product-suggestion-price { font-size: 14px; font-weight: 600; color: var(--cam-primary, #8b5cf6); margin: 0; }

/* AI Stylist Product Grid Styles */
.cam-products-header { padding: 20px 30px; border-bottom: 1px solid var(--cam-border); display: flex; justify-content: space-between; align-items: center; background: #fff; }
.cam-products-title { margin: 0; font-size: 18px; color: var(--cam-text-dark); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cam-products-body { flex: 1; overflow-y: auto; padding: 30px; background: #f8fafc; }
.cam-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.cam-product-card { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--cam-border); box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: transform 0.2s; display: flex; flex-direction: column; }
.cam-product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }
.cam-product-img-wrap { position: relative; width: 100%; aspect-ratio: 4/5; overflow: hidden; }
.cam-product-img { width: 100%; height: 100%; object-fit: cover; }
.cam-product-badge { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.9); padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; color: #1e293b; backdrop-filter: blur(4px); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.cam-product-info { padding: 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; justify-content: space-between; }
.cam-product-title { font-size: 14px; font-weight: 500; color: #1e293b; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.cam-product-price { font-size: 16px; font-weight: 600; color: var(--cam-primary, #8b5cf6); margin: 0; }
.cam-product-actions { display: flex; gap: 8px; margin-top: 8px; }
.cam-product-actions a { flex: 1; text-align: center; padding: 8px; font-size: 12px; border-radius: 8px; text-decoration: none; font-weight: 600; color: #fff; transition: opacity 0.2s; }
.cam-product-actions a:hover { opacity: 0.9; }
.cam-btn-shopee { background: #ee4d2d; }
.cam-btn-lazada { background: #0f146d; }

