/* =========================================================
   🎨 DESIGN TOKENS (COLOR SYSTEM)
========================================================= */
:root {
    /* Brand */
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;

    /* Backgrounds */
    --bg-main: #0f172a;
    --bg-card: #ffffff;
    --bg-soft: #f1f5f9;
    --bg-muted: #e2e8f0;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-inverse: #ffffff;

    /* Borders */
    --border-light: rgba(0,0,0,0.06);

    /* States */
    --danger: #ef4444;
}

/* DARK MODE TOKENS */
body.dark-mode {
    --bg-main: #020617;
    --bg-card: #0f172a;
    --bg-soft: #1e293b;
    --bg-muted: #334155;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;

    --border-light: rgba(255,255,255,0.08);
}


/* =========================================================
   🌍 GLOBAL STYLES
========================================================= */
body {
    font-family: system-ui, -apple-system, sans-serif;
        background: radial-gradient(
        circle at center,
        #0f172a 0%,
        #020617 100%
    );
    color: var(--text-primary);
    margin: 0;
}

.hidden {
    display: none;
}


/* =========================================================
   💰 PRICING SECTION (CLEAN SYSTEM)
========================================================= */
.pricing-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;
}

.pricing-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;

    max-width: 1100px;
    width: 100%;
}

@media (min-width: 768px) {
    .pricing-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Base card */
.pricing-card {
    position: relative;

    padding: 24px;
    border-radius: 16px;

    background: #1e293b;
    color: white;

    box-shadow: 0 10px 25px rgba(0,0,0,0.2);

    transition: all 0.25s ease;
}

.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

/* Title */
.pricing-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Price */
.pricing-price {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 16px;
}

.pricing-price span {
    font-size: 14px;
    color: #94a3b8;
}

/* Features */
.pricing-features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.pricing-features li {
    margin: 8px 0;
    color: #cbd5f5;
}

/* Button */
.pricing-btn {
    width: 100%;
    padding: 10px;

    border-radius: 10px;
    border: none;

    background: #3b82f6;
    color: white;

    cursor: pointer;
    transition: all 0.2s ease;
}

.pricing-btn:hover {
    background: #2563eb;
}

/* Popular */
.pricing-popular {
    border: 2px solid #3b82f6;
    transform: scale(1.05);
}

/* Badge */
.pricing-badge {
    position: absolute;
    top: -10px;
    right: 10px;

    background: #3b82f6;
    font-size: 12px;

    padding: 4px 8px;
    border-radius: 6px;
}

/* Enterprise */
.pricing-enterprise {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #475569;
}

.pricing-btn-enterprise {
    background: #8b5cf6;
}

.pricing-btn-enterprise:hover {
    background: #7c3aed;
}


/* =========================================================
   🔘 BUTTONS
========================================================= */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;

    background: #3b82f6;
    color: white;

    cursor: pointer;
    transition: background 0.2s ease;
}

button:hover {
    background: #2563eb;
}

.copy-code {
    color: white;
}

.copy-code:hover {
    background-color: rgba(0, 255, 0, 0.501);
}


/* =========================================================
   💬 CHAT LAYOUT
========================================================= */
.main-wrapper {
    padding-top: 15px;
    display: flex;
    gap: 40px;

    max-width: 1200px;
    width: 100%;

    transform: translateX(-40px); /* 🔥 magic line */
}

.chat-container {
    width: 800px;
    height: 500px;

    flex: 1;
    min-width: 0;

    margin: 24px auto;

    display: flex;
    flex-direction: column;
    position: relative; /* 🔥 THIS must exist */

    background: var(--bg-card);
    border-radius: 16px;

    box-shadow: 0 12px 30px rgba(0,0,0,0.08);

    overflow: visible; /* 🔥 CRITICAL */
    
}

.chat-inner {
    height: 100%;
    display: flex;
    flex-direction: column;

    overflow: hidden; /* 🔥 clip ONLY inside */
    border-radius: 16px; /* match container */
}

.logo-wrapper {
    position: absolute;
    top: -30px;
    left: -30px;

    display: inline-block;
    
}

/* Floating logo */
.chat-logo {

    position: relative; /* or just delete position entirely */

    width: auto;
    height: 50px;

    padding: 4px 6px;

    background: rgb(34, 32, 32);
    border-radius: 10px;

    transform: rotate(-5deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);

    z-index: 100;
    transition: all 0.2s ease;
    display: block;     /* 🔥 prevents weird inline spacing */
}

.chat-logo:hover {
    transform: rotate(0deg) scale(1.05);
}

/* overlay */
.logo-overlay {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    display: flex;

    /* 👇 THIS is what you tweak */
    justify-content: flex-end;
    align-items: flex-start;

    padding: 4px;
    gap: 6px;

    transform: translateX(8px); /* 👉 move buttons right */

    opacity: 0;
    transition: 0.2s ease;

    z-index: 200;   /* 🔥 higher than logo */
}

.logo-wrapper:hover .logo-overlay {
    opacity: 1;
}

/* buttons */
.logo-action {
    background: white;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    transition: 0.15s;
}

.logo-action:hover {
    transform: scale(1.1);
}

/* =========================================================
   💬 CHAT CONTENT
========================================================= */
.chat-box {
    flex: 1;
    padding: 20px;
    height: 100%;        /* 🔥 key fix */
    max-height: 100%;    /* 🔥 prevents growth */

    display: flex;
    flex-direction: column;
    gap: 12px;

    overflow-y: auto;

    scrollbar-gutter: stable; /* prevents width shift */

}

/* Messages */
.message {
    max-width: 75%;
    padding: 12px 16px;

    border-radius: 16px;
    line-height: 1.4;
    font-size: inherit;
}

.message.ai {
    align-self: flex-start;

    background: var(--bg-soft);
    color: var(--text-primary);
}

.message.user {
    background: var(--color-primary);
    color: white;

    align-self: flex-end;
}


/* =========================================================
   ✍️ CHAT INPUT (MODERN SAAS STYLE)
========================================================= */
.chat-form {
    display: flex;
    gap: 10px;

    margin: 12px;
    padding: 10px 12px;

    background: var(--bg-soft);
    border: 1px solid var(--border-light);
    border-radius: 14px;

    transition: all 0.2s ease;
}

/* Input field */
#user-input {
    flex: 1;
    padding: 12px 14px;

    border: none;
    outline: none;
    border-radius: 10px;

    background: transparent;
    font-size: 14px;
    color: #0f172a;
}

/* Placeholder */
#user-input::placeholder {
    color: #94a3b8;
}

/* Focus state (important for UX) */
.chat-form:focus-within {
    background: var(--bg-card);
    box-shadow: 0 0 0 2px var(--color-primary);
}

/* Send button */
#send-btn {
    height: 40px;
    min-width: 40px;

    border-radius: 10px;
    border: none;

    background: var(--color-primary);
    color: white;

    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover */
#send-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

/* Active click */
#send-btn:active {
    transform: scale(0.95);
}

/* Disabled */
#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   🌙 DARK MODE
========================================================= */

body.dark-mode .chat-container {
    background: #1e293b;
}

body.dark-mode .message.ai {
    background: #334155;
    color: white;
}

body.dark-mode .message.user {
    background: #3b82f6;
    color: white;
}

body.dark-mode form {

    background: #121924;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}


/* Focus state (important for UX) */
body.dark-mode form:focus-within {
    box-shadow: 0 0 0 2px #3b82f6;
    background: #1e293b;
}

/* Input field */
body.dark-mode form #user-input {
    flex: 1;
    padding: 12px 14px;

    border: none;
    outline: none;
    border-radius: 10px;

    background: transparent;
    font-size: 14px;
    color: #ffffff !important;
}


/* =========================================================
   ⚙️ SETTINGS UI
========================================================= */
.settings-bar {
    position: absolute;
    top: 50%;
    right: -80px; /* fixed width alignment */

    transform: translateY(-50%);

    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 10px;

    background: rgba(255,255,255,0.06);
    border-radius: 14px;
    backdrop-filter: blur(10px);
}

.settings-bar .group-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 6px 0;
}

.icon-btn {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: white;
    border: none;
    border-radius: 12px;

    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);

    transition: all 0.2s ease;
}

.icon-btn i {
    font-size: 20px;
    color: #333;
}

.icon-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Locked / premium button */
.icon-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;

    position: relative;

    background: rgba(249, 245, 245, 0.05);
}

/* Prevent hover lift */
.icon-btn.locked:hover {
    transform: none;
    box-shadow: none;
}

/* Optional: slightly muted icon */
.icon-btn.locked i {
    color: #94a3b8;
}

/* subtle overlay */
.icon-btn.locked::after {
    content: "";
    position: absolute;
    inset: 0;

    border-radius: 12px;
    background: rgba(0,0,0,0.2);
}


/* =========================================================
   🔤 FONT SIZE MENU
========================================================= */
.font-size-wrapper {
    position: relative;
}

.font-menu {
    position: absolute;
    top: 0;
    right: 60px;

    display: flex;
    flex-direction: column;
    gap: 5px;

    padding: 8px;

    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);

    z-index: 200;
}

.font-menu button {
    padding: 6px 10px;
    border-radius: 6px;

    background: #6d6c6c;
    border: none;

    cursor: pointer;
}

.font-menu button:hover {
    background: #9b9a9a;
}

.font-menu button.active {
    background: #3b82f6;
    color: white;
}

/* Font sizes */
.chat-box.font-14 { font-size: 14px; }
.chat-box.font-16 { font-size: 16px; }
.chat-box.font-18 { font-size: 18px; }
.chat-box.font-20 { font-size: 20px; }


/* =========================================================
   📄 DOCUMENT PANEL
========================================================= */
.doc-panel {
    width: 100%;
    margin: 0;

    padding: 16px;

    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;

    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);

    transition: all 0.2s ease;

    display: flex;
    flex-direction: column;
    gap: 24px; /* 🔥 clean spacing between chat + docs */
}

.doc-panel:hover {
    border-color: rgba(59,130,246,0.3);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    transform: translateY(-2px);
}

.doc-header {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    /* padding: 6px 10px; */

    background: white;
    /* border-radius: 8px; */

    font-size: 13px;
    color: #334155;

    transition: background 0.2s ease;


    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;

    transition: 0.2s ease;
}

.doc-item:hover {
    background: #e2e8f0;
}

.doc-delete {
    background: transparent;
    border: none;

    font-size: 12px;
    color: #94a3b8;

    cursor: pointer;
    transition: all 0.2s ease;
}

.doc-delete:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.doc-empty {
    padding: 10px;

    font-size: 12px;
    text-align: center;
    color: #94a3b8;
}

/* =========================================================
   📄 CENTER PANEL
========================================================= */
.center-panel {
    gap: 20px;
}

/* =========================================================
   📄 PAGE CONTAINER
========================================================= */
.page-container {
    display: flex;
    justify-content: center;
    width: 100%;
}


/* =========================================================
   ✨ MISC
========================================================= */
.dots::after {
    content: "...";
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}


/* =========================================================
   🧭 NAVBAR (MODERN SAAS STYLE)
========================================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 28px;

    position: sticky;
    top: 0;
    z-index: 9999;

    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--border-light);
}

/* Left side */
.nav-left {
    display: flex;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 16px;

    transition: opacity 0.2s ease;
}

.nav-logo img {
    height: 28px;
}

.nav-logo:hover {
    opacity: 0.8;
}

/* Right side */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* =========================================================
   🔘 NAV BUTTONS
========================================================= */
.nav-btn {
    padding: 8px 14px;

    border-radius: 10px;
    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    transition: all 0.2s ease;
}

/* Secondary (neutral) */
.nav-btn-secondary {
    background: #1e293b;
    color: #e2e8f0;
}

.nav-btn-secondary:hover {
    background: #334155;
}

/* Primary (CTA) */
.nav-btn-primary {
    background: var(--color-primary);
    color: white;
}

.nav-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Danger */
.nav-btn-danger {
    background: var(--danger);
    color: #e2e8f0;
}

.nav-btn-danger:hover {
    background: #dc2626;
}

.nav-logo img {
    height: 38px;
    width: auto;
}


/* =========================================================
   🔘 MODAL CONTENT
========================================================= */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary, #1e1e1e);
    color: var(--text-primary, #ffffff);
    padding: 20px;
    border-radius: 16px;
    width: 520px;          /* ⬅️ was ~400px */
    max-width: 90vw;       /* responsive safety */
    z-index: 2;

    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

#embed-code {
    width: 100%;
    height: 135px;         /* ⬅️ increase from 120px */
    overflow: hidden;      /* ⬅️ removes scroll */
    margin: 10px 0;
    padding: 10px;

    background: #111;
    color: #0f0;
    font-family: monospace;
    line-height: 1.5;
    font-size: 13px;

    border: none;
    border-radius: 8px;

    resize: none;
}


/* =========================================================
   🔘 USAGE CONTENT
========================================================= */

/* LEFT */
.usage-panel {
    width: 260px;
    flex-shrink: 0;

    display: flex;
    justify-content: center;   /* 🔥 centers card horizontally */

    align-items: flex-start;
    padding-top: 30px;
}

.usage-card {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.plan-badge {
    background: #2563eb;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.usage-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.label {
    font-size: 12px;
    color: #888;
}

.value {
    font-size: 16px;
    font-weight: bold;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #222;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #22c55e;
    transition: width 0.3s ease;
}

.usage-percent {
    font-size: 12px;
    margin-top: 8px;
    color: #aaa;
}

.upgrade-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 12px;
    background: #2563eb;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-size: 14px;
}

.bg-green { background: #22c55e; }
.bg-yellow { background: #f59e0b; }
.bg-red { background: #ef4444; }



#cancel-btn {
    transition: all 0.2s ease;
}

#cancel-btn:hover {
    transform: translateY(-1px);
}


.pricing-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.03); /* subtle dark glass */
    border: 1px solid rgba(255, 255, 255, 0.08);

    color: #e5e7eb; /* light gray text */
    font-size: 14px;

    resize: none;
    min-height: 100px;

    transition: all 0.2s ease;
}

.pricing-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.pricing-input:focus {
    outline: none;
    border-color: #6366f1; /* subtle indigo */
    background: rgba(255, 255, 255, 0.05);
}