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

:root {
    --bg-color: #343541;
    --chat-bg: #444654;
    --user-bubble: #007AFF;
    --ai-bubble: #444654;
    --text-color: #D1D5DB;
    --text-dark: #374151;
    --accent-color: #007AFF;
    --brand-color: #10A37F;
    --header-bg: rgba(52, 53, 65, 0.9);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.contact-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.main-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6rem 1rem 4rem;
    min-height: calc(100vh - 120px);
}

.chat-window {
    width: 100%;
    max-width: 800px;
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

.chat-messages {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 163, 127, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    color: var(--brand-color);
    flex-shrink: 0;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message.ai {
    justify-content: flex-start;
}

.message.user .message-content {
    background: var(--user-bubble);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 0.75rem 1rem;
    max-width: 70%;
}

.message.ai .message-content {
    background: var(--ai-bubble);
    border-radius: 18px 18px 18px 4px;
    padding: 0.75rem 1rem;
    max-width: 70%;
}

.message.user .avatar {
    display: none;
}

.message.ai .avatar {
    display: flex;
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.875rem;
}

.user .avatar {
    background: var(--accent-color);
    color: white;
}

.ai .avatar {
    background: var(--brand-color);
    color: white;
}

.message-content {
    flex: 1;
    line-height: 1.6;
    font-size: 1rem;
    position: relative;
}

.message-content .typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--text-color);
    animation: blink 0.7s infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

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

.message-content .highlight {
    font-weight: 600;
    color: var(--brand-color);
}

.message-content .keyword {
    background: rgba(16, 163, 127, 0.15);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 500;
}

.message-content .keyword.phone-link {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.message-content .keyword.phone-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.message-content .keyword.website-link {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.message-content .keyword.website-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.message-content .loading {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.message-content .loading span {
    width: 8px;
    height: 8px;
    background: var(--text-color);
    border-radius: 50%;
    animation: loading 1.4s infinite ease-in-out both;
    opacity: 0.4;
}

.message-content .loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.message-content .loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.chat-input-container {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    position: relative;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 48px;
    bottom: 0;
    cursor: pointer;
    z-index: 10;
}

.chat-input::placeholder {
    color: rgba(209, 213, 219, 0.5);
}

.chat-input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.15);
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: scale(1.05);
}

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

.send-btn.pressed {
    background: #003d82;
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.suggestion-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 163, 127, 0.15);
    border: 1px solid rgba(16, 163, 127, 0.3);
    border-radius: 20px;
    padding: 0.625rem 1rem;
    margin-top: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: chipSlideIn 0.5s ease-out;
}

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

.suggestion-chip:hover {
    background: rgba(16, 163, 127, 0.25);
    transform: translateY(-2px);
}

.chip-icon {
    font-size: 1.125rem;
}

.chip-text {
    font-size: 0.875rem;
    color: var(--brand-color);
    font-weight: 500;
}

.footer {
    background: rgba(52, 53, 65, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer p {
    font-size: 0.75rem;
    color: rgba(209, 213, 219, 0.6);
    margin: 0.25rem 0;
}

.phone-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.phone-link:hover {
    color: #0056b3;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-color);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.contact-item a,
.contact-item span {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9375rem;
}

.contact-item a:hover {
    color: var(--accent-color);
}

.modal-note {
    font-size: 0.8125rem;
    color: rgba(209, 213, 219, 0.6);
    text-align: center;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .header-content {
        padding: 0 1.5rem;
    }

    .chat-window {
        max-width: 90%;
    }

    .main-container {
        padding: 5.5rem 1rem 4rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 0.9375rem;
    }

    .contact-btn {
        padding: 0.4375rem 1rem;
        font-size: 0.8125rem;
    }

    .main-container {
        padding: 5rem 1rem 3rem;
    }

    .chat-window {
        max-height: 75vh;
        width: 95%;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message {
        padding: 1rem;
        gap: 0.75rem;
    }

    .message.user .message-content,
    .message.ai .message-content {
        max-width: 80%;
    }

    .avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    .message-content {
        font-size: 0.9375rem;
    }

    .chat-input-container {
        padding: 0.75rem 1rem;
    }

    .send-btn {
        width: 40px;
        height: 40px;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo svg {
        width: 28px;
        height: 28px;
    }

    .logo-text {
        font-size: 0.875rem;
    }

    .contact-btn {
        padding: 0.375rem 0.875rem;
        font-size: 0.75rem;
    }

    .chat-window {
        border-radius: 8px;
    }

    .message {
        padding: 0.875rem;
    }

    .message.user .message-content,
    .message.ai .message-content {
        max-width: 85%;
    }

    .message-content {
        font-size: 0.875rem;
    }

    .suggestion-chip {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .phone-link {
        color: var(--accent-color);
        text-decoration: underline;
    }

    .footer-content {
        padding: 0 0.75rem;
    }

    .footer p {
        font-size: 0.6875rem;
        word-wrap: break-word;
    }
}
