:root {
    --contact-bg: var(--color-bg-base, #0A0A0B);
    --contact-bg-secondary: var(--color-bg-surface, #111113);
    --contact-text: #ffffff;
    --contact-text-muted: rgba(255, 255, 255, 0.6);
    --contact-border: rgba(255, 255, 255, 0.1);
    --contact-green: var(--color-brand-primary, #3AAFD4);
    --contact-purple: var(--color-brand-secondary, #3AAFD4);
    --contact-user-bubble: var(--color-bg-elevated, #1A1A1E);
    --contact-assistant-bubble: transparent;
}

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

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--contact-bg);
    color: var(--contact-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.contact-background-sphere {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.contact-background-sphere canvas {
    width: 100%;
    height: 100%;
}

.contact-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.contact-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 100px 24px 20px;
    overflow-y: auto;
}

.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 40px 0;
}

.contact-content.chat-started {
    display: none;
}

.contact-header {
    margin-bottom: 48px;
}

.contact-title {
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.contact-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--contact-text-muted);
    max-width: 650px;
    margin: 0 auto;
}

.contact-quick-questions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 800px;
    width: 100%;
}

.contact-question-btn {
    background: var(--contact-bg-secondary);
    border: 1px solid var(--contact-border);
    border-radius: 12px;
    padding: 16px 14px;
    color: var(--contact-text-muted);
    font-size: 14px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}

.contact-question-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--contact-text);
    background: rgba(255, 255, 255, 0.05);
}

.contact-messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
}

.contact-message {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.contact-message.user {
    justify-content: flex-end;
}

.contact-message.assistant {
    justify-content: flex-start;
}

.contact-message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
}

.contact-message.user .contact-message-bubble {
    background: var(--contact-user-bubble);
    border: 1px solid var(--contact-border);
    border-radius: 18px 18px 4px 18px;
}

.contact-message.assistant .contact-message-bubble {
    background: var(--contact-assistant-bubble);
    border-radius: 18px 18px 18px 4px;
}

.contact-message-bubble.deon-typing-effect {
    min-height: 0;
    overflow: hidden;
    transition: max-height 0.15s ease-out;
}

.contact-message-bubble a {
    color: var(--contact-green);
    text-decoration: none;
}

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

.contact-loading-sphere {
    width: 50px;
    height: 50px;
    position: relative;
}

.contact-loading-sphere canvas {
    width: 100%;
    height: 100%;
}

.contact-input-area {
    padding: 16px 24px 32px;
    background: linear-gradient(to top, var(--contact-bg) 0%, var(--contact-bg) 50%, transparent 100%);
    position: sticky;
    bottom: 0;
}

.contact-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--contact-bg-secondary);
    border: 1px solid var(--contact-border);
    border-radius: 24px;
    padding: 8px 12px 8px 8px;
    transition: border-color 0.2s ease;
}

.contact-input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.25);
}

.contact-attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: var(--contact-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.contact-attach-btn svg {
    width: 18px;
    height: 18px;
}

.contact-attach-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--contact-text);
}

.contact-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--contact-text);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    padding: 8px 0;
    min-height: 24px;
    max-height: 150px;
    line-height: 1.5;
}

.contact-input::placeholder {
    color: var(--contact-text-muted);
}

.contact-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--contact-text);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.contact-send-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--contact-bg);
}

.contact-send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.contact-send-btn:not(:disabled):hover {
    transform: scale(1.05);
}

.contact-attachment-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.contact-attachment-preview img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.contact-attachment-preview .remove-attachment {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--contact-text-muted);
    cursor: pointer;
    padding: 4px;
}

.contact-attachment-preview .remove-attachment:hover {
    color: var(--contact-text);
}

@media (max-width: 768px) {
    .contact-quick-questions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-main {
        padding: 40px 16px 20px;
    }
    
    .contact-input-area {
        padding: 16px 16px 24px;
    }
}

@media (max-width: 480px) {
    .contact-quick-questions {
        grid-template-columns: 1fr;
    }
    
    .contact-question-btn {
        padding: 14px 12px;
    }
}

body.light-mode {
    --contact-bg: #E8ECF1;
    --contact-bg-secondary: #FFFFFF;
    --contact-text: #1A1A1E;
    --contact-text-muted: #59616E;
    --contact-border: rgba(0, 0, 0, 0.1);
    --contact-user-bubble: #E8EDFA;
    background: #E8ECF1;
}

body.light-mode .contact-title {
    color: #1A1A1E;
}

body.light-mode .contact-description {
    color: #59616E;
}

body.light-mode .contact-question-btn {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #3D4550;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-mode .contact-question-btn:hover {
    border-color: rgba(0, 0, 0, 0.15);
    color: #1A1A1E;
    background: #F8FAFC;
}

body.light-mode .contact-message.user .contact-message-bubble {
    background: #E8EDFA;
    border: 1px solid rgba(26, 122, 158, 0.1);
    color: #1A1A1E;
}

body.light-mode .contact-message.assistant .contact-message-bubble {
    color: #2C333D;
}

body.light-mode .contact-input-area {
    background: linear-gradient(to top, #E8ECF1 0%, #E8ECF1 50%, transparent 100%);
}

body.light-mode .contact-input-wrapper {
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-mode .contact-input-wrapper:focus-within {
    border-color: rgba(26, 122, 158, 0.3);
}

body.light-mode .contact-input {
    color: #2C333D;
}

body.light-mode .contact-input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

body.light-mode .contact-attach-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #59616E;
}

body.light-mode .contact-attach-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1A1A1E;
}

body.light-mode .contact-send-btn {
    background: #1A7A9E;
}

body.light-mode .contact-send-btn svg {
    stroke: #FFFFFF;
}

body.light-mode .contact-attachment-preview {
    background: rgba(0, 0, 0, 0.03);
}

body.light-mode .contact-attachment-preview .remove-attachment {
    color: #59616E;
}

body.light-mode .contact-attachment-preview .remove-attachment:hover {
    color: #1A1A1E;
}
