:root {
    --primary-blue: #0b5cff;
    --primary-blue-hover: #0046d5;
    --secondary-gray: #f5f5f5;
    --secondary-gray-hover: #e8e8e8;
    --text-dark: #131619;
    --text-muted: #6e7680;
    --border-color: #d2d2d2;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    color: var(--text-dark);
    line-height: 1.5;
    background-color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* Header */
.header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: var(--white);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: block;
}

.action-btns {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    text-decoration: none;
    color: var(--primary-blue);
    font-size: 13px;
    font-weight: 500;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.language-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: var(--shadow);
    list-style: none;
    padding: 8px 0;
    margin-top: 8px;
    z-index: 200;
}

.dropdown-menu li {
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-menu li:hover {
    background-color: #f5f5f5;
}

.dropdown-menu.hidden {
    display: none;
}


.arrow-down::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--primary-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 24px; /* Space for fixed header */
}

.join-container {
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.join-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
}

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

.btn-secondary {
    background-color: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #eee;
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.btn-secondary:hover {
    background-color: var(--secondary-gray);
}

/* Popover */
.popover {
    position: absolute;
    top: 0;
    left: calc(100% + 20px);
    width: 300px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: left;
    border: 1px solid #eee;
    z-index: 10;
}

.popover.hidden {
    display: none;
}

.popover-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.popover-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    padding-right: 20px;
}

.popover-text {
    font-size: 12px;
    color: var(--text-dark);
    line-height: 1.4;
}

.popover-text a {
    color: var(--primary-blue);
    text-decoration: none;
}

/* Download Section */
.download-section {
    margin-top: 24px;
}

.download-section p {
    font-size: 14px;
    margin-bottom: 12px;
}

.download-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.legal-text {
    font-size: 12px;
    color: var(--text-muted);
}

.legal-text a {
    color: var(--primary-blue);
    text-decoration: none;
}

/* Footer */
.footer {
    padding: 24px;
    background-color: var(--white);
    border-top: 1px solid #f0f0f0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.copyright {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Chat Bubble */
.chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chat-bubble:hover {
    transform: scale(1.05);
}

/* SDK Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
    pointer-events: none;
}


.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.modal-container {
    position: relative;
    background: var(--white);
    width: 440px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.modal-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.modal-logo img {
    height: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 32px;
    text-align: center;
}

.update-icon {
    margin-bottom: 24px;
    background: #f0f6ff;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.modal-body h2 {
    font-size: 24px;
    margin-bottom: 24px;
}

.error-box {
    background: #fdf2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    margin-bottom: 24px;
}

.error-title {
    font-weight: 700;
    font-size: 14px;
    color: #b91c1c;
    margin-bottom: 4px;
}

.error-detail {
    font-size: 13px;
    color: #4b5563;
}

.version-info {
    margin-bottom: 24px;
}

.version-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    color: #4b5563;
}

.version-num {
    font-family: monospace;
    font-weight: 600;
}

.issue-text {
    font-weight: 700;
    color: var(--text-dark);
}

.update-btn {
    width: 100%;
    margin-bottom: 16px;
}

.more-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    height: 600px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.chat-window.hidden {
    display: none;
    pointer-events: none;
}


.chat-header {
    background: linear-gradient(135deg, #0b5cff 0%, #a855f7 100%);
    padding: 16px;
    color: var(--white);
}

.chat-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.chat-controls button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: 8px;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-message {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-bubble {
    background-color: var(--primary-blue) !important;
    color: white !important;
    border-bottom-right-radius: 4px !important;
}

.agent-message {
    align-self: flex-start;
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.agent-avatar {
    flex-shrink: 0;
}

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 8px;
}

.agent-avatar img {
    width: 100%;
}

.agent-info {
    margin-bottom: 8px;
}

.agent-name {
    font-weight: 700;
    font-size: 12px;
    margin-right: 4px;
}

.agent-badge {
    font-size: 10px;
    background: #f0f6ff;
    color: var(--primary-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.chat-bubble-msg {
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 0 12px 12px 12px;
    font-size: 14px;
    margin-bottom: 8px;
    max-width: 85%;
}

.chat-options {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-btn {
    background: var(--white);
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: #f0f6ff;
}

.chat-input-container {
    padding: 16px;
    border-top: 1px solid #eee;
}

.input-wrapper {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    border: none;
    background: none;
    padding: 8px;
    font-size: 14px;
    outline: none;
    margin-bottom: 8px;
}

.input-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.send-btn {
    margin-left: auto;
    background: #f3f4f6;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #9ca3af;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.chat-disclaimer {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Cookie modal specific */
.cookie-container {
    width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cookie-body {
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cookie-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: left;
}

.cookie-scroll {
    overflow-y: auto;
    padding-right: 12px;
}

.cookie-desc {
    font-size: 13px;
    color: #4b5563;
    text-align: left;
    margin-bottom: 16px;
    line-height: 1.6;
}

.cookie-desc a {
    color: var(--primary-blue);
    text-decoration: underline;
}

.accept-all-btn {
    width: auto;
    padding: 10px 40px;
    margin: 10px 0 30px 0;
    font-size: 14px;
    letter-spacing: 1px;
}

.manage-consent h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.consent-item {
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
}

.consent-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.toggle-icon {
    font-size: 18px;
    color: var(--text-muted);
    margin-right: 12px;
    font-weight: 300;
}

.consent-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.always-active {
    font-size: 12px;
    color: #10b981;
    font-weight: 700;
}

/* Switches */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-blue);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.confirm-btn {
    width: auto;
    font-size: 13px;
    letter-spacing: 1px;
}


