:root {
    /* Primary colors - soft teal/blue */
    --primary-purple: #7eb3c4;
    --primary-dark: #5a9aad;
    --primary-hover: #6aa8ba;

    /* Secondary colors - muted sage */
    --secondary-purple: #a8b5a4;
    --secondary-hover: #93a08f;

    /* Accent colors - gentle pastels */
    --accent-blue: #8db4d8;
    --accent-green: #a5c9a1;
    --accent-red: #e8a5a5;

    /* Persona colors - soft pastels */
    --persona-a-bg: #e8f3f7;
    --persona-a-text: #5a8fa1;
    --persona-b-bg: #f5f0f5;
    --persona-b-text: #9b7ba8;
    --persona-c-bg: #f0f5ed;
    --persona-c-text: #7a9e75;
    --persona-d-bg: #fdf5ea;
    --persona-d-text: #c4a572;

    /* UI colors - soft neutrals */
    --bg-light: #f7f8fa;
    --bg-white: white;
    --bg-gray: #f9fafb;
    --text-primary: #4a5568;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    --text-dark: #2d3748;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    --border-dark: #a0aec0;

    /* Code display */
    --code-bg: #2d3748;
    --code-text: #9ae6b4;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    color: var(--primary-purple);
    font-size: 2.5em;
    margin-bottom: 10px;
    text-align: center;
}

h2 {
    color: var(--text-secondary);
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
}

h3 {
    color: var(--text-primary);
    font-size: 1.2em;
    margin-bottom: 10px;
}

.info-box {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-purple);
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.info-box.small {
    font-size: 0.9em;
    padding: 15px;
}

.info-box ul {
    margin-left: 20px;
    margin-top: 10px;
}

.info-box li {
    margin: 8px 0;
}

.button-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--secondary-purple);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

/* Robot Check - reCAPTCHA style */
.robot-check {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 400px;
}

.recaptcha-box {
    background: var(--bg-gray);
    border: 1px solid var(--border-medium);
    border-radius: 3px;
    width: 304px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.recaptcha-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    background: var(--bg-white);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
    border: 2px solid var(--border-dark);
    border-radius: 2px;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    background: var(--bg-white);
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.kitt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    overflow: hidden;
    pointer-events: none;
}

.kitt-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(66, 133, 244, 0.3) 20%,
        rgba(66, 133, 244, 0.8) 50%,
        rgba(66, 133, 244, 0.3) 80%,
        transparent 100%);
    animation: kitt-sweep 1s ease-in-out;
}

@keyframes kitt-sweep {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: -100%;
    }
}

.checkbox-wrapper label {
    font-family: Roboto, arial, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    user-select: none;
}

.recaptcha-logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recaptcha-logo img {
    width: 100%;
    height: 100%;
}

.recaptcha-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-gray);
    border-top: 1px solid var(--border-medium);
    font-size: 10px;
    color: var(--text-secondary);
}

.recaptcha-footer span {
    font-weight: 600;
    color: var(--text-tertiary);
}

.recaptcha-links {
    display: flex;
    gap: 4px;
}

.recaptcha-links a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 10px;
}

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

/* Chat Code Display */
.chat-code-box, .chat-link-box {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.code-display {
    background: var(--code-bg);
    color: var(--code-text);
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    word-break: break-all;
    letter-spacing: 2px;
}

/* Form Styles */
.form-container {
    margin: 30px 0;
}

.form-group {
    margin: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-purple);
}

/* Chat Interface */
#chat-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-light);
}

.chat-wrapper {
    display: grid;
    grid-template-rows: auto 1fr auto;
    max-width: 1200px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    background: var(--bg-white);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.chat-header {
    background: var(--primary-purple);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    color: white;
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s;
}

.chat-title:hover {
    opacity: 0.8;
}

.chat-id {
    font-family: monospace;
    font-size: 0.9em;
    opacity: 0.9;
}

.messages-container {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: var(--bg-gray);
}

.message {
    margin: 15px 0;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

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

.message .persona {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.message.person-a {
    background: var(--persona-a-bg);
    margin-right: auto;
}

.message.person-a .persona {
    color: var(--persona-a-text);
}

.message.person-b {
    background: var(--persona-b-bg);
    margin-left: auto;
}

.message.person-b .persona {
    color: var(--persona-b-text);
}

.message.person-c {
    background: var(--persona-c-bg);
    margin-right: auto;
}

.message.person-c .persona {
    color: var(--persona-c-text);
}

.message.person-d {
    background: var(--persona-d-bg);
    margin-left: auto;
}

.message.person-d .persona {
    color: var(--persona-d-text);
}

.message.system-message {
    background: var(--bg-light);
    border: 1px dashed var(--border-light);
    margin-right: auto;
    cursor: pointer;
}

.message.system-message .persona {
    color: var(--text-secondary);
}

.message.system-message:hover {
    border-color: var(--border-dark);
    background: var(--bg-white);
}

.message-file {
    margin-top: 10px;
}

.message-file img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    cursor: pointer;
}

.message-file a {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 600;
}

.message-file a:hover {
    text-decoration: underline;
}

.input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
}

.upload-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-purple);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

#message-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    border-radius: 20px;
    font-size: 1em;
    resize: none;
    font-family: inherit;
    max-height: 120px;
    overflow-y: auto;
}

#message-input:focus {
    outline: none;
    border-color: var(--primary-purple);
}

.send-btn {
    padding: 10px 25px;
    background: var(--primary-purple);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

/* QR Code Modal */
#qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#qr-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
}

#qr-scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#qr-video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .button-container {
        flex-direction: column;
    }

    h1 {
        font-size: 2em;
    }

    .message {
        max-width: 85%;
    }

    #message-input {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    #message-input::-webkit-scrollbar {
        display: none;
    }
}
