* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #FEEAF3;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Header */
.topbar {
    background-color: #ffffff;
    border-bottom: none;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0;
    width: 100%;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #000000;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.brand .name {
    color: #000000;
    font-weight: 700;
}

.menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #666;
    font-size: 0.95rem;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.menu a:hover {
    color: #333;
    background-color: #f5f5f5;
}

.menu a.active {
    color: #ec4899;
    font-weight: 500;
    background-color: #fef2f2;
}

.menu a svg {
    flex-shrink: 0;
}

.menu a.active svg path {
    stroke: #ec4899;
}

.avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.avatar:hover {
    background-color: #f5f5f5;
}

.badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ec4899;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.badge svg {
    width: 18px;
    height: 18px;
}

.caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #666;
    transition: transform 0.3s;
}

.avatar:hover .caret {
    border-top-color: #333;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 3rem 2rem;
    background-color: #FEEAF3;
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    width: 100%;
    justify-content: flex-start;
}

.pink-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ec4899;
}

.section-title {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

/* Messages Container */
.messages-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
    align-items: stretch;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

/* Custom scrollbar for messages container */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #ec4899;
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #db2777;
}

.message-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.message-item.message-right {
    justify-content: flex-end;
}

.message-item:has(.cpf-display-box) {
    justify-content: flex-end;
}

.message-item.message-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Banner */
.banner {
    margin: 0;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.banner-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* CPF Section */
.cpf-section {
    background-color: transparent;
    padding: 0;
    margin: 0;
    width: 100%;
}

.cpf-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cpf-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.cpf-title {
    font-size: 1.25rem;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.instruction-message {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cpf-instructions {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.instruction-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.green-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.instruction-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.instruction-text strong {
    font-weight: 600;
    color: #333;
}

.instruction-note {
    color: #888;
    font-size: 0.9rem;
}

.cpf-example {
    margin-left: 0;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.cpf-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: nowrap;
    width: 100%;
}

.form-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
}

.cpf-input {
    flex: 0 1 auto;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    width: 300px;
    max-width: 100%;
}

.cpf-input:focus {
    outline: none;
    border-color: #ec4899;
}

.cpf-input::placeholder {
    color: #999;
}

.continue-button {
    background-color: #ec4899;
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
}

.continue-button::after {
    content: '▶';
    font-size: 1rem;
    color: white;
    line-height: 1;
}

.continue-button:hover {
    background-color: #db2777;
}

.continue-button:active {
    transform: scale(0.98);
}

/* Message Area */
.message-area {
    margin: 0;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

.loading-dots .loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots .loading-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.message-content {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cpf-display-box {
    background-color: #d1fae5;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    letter-spacing: 0.05em;
    box-sizing: border-box;
    display: inline-block;
    max-width: fit-content;
    margin-left: auto;
    margin-right: 0;
}

/* Conversation Flow Styles */
.message-image {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.conversation-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.message-audio {
    margin: 0;
    padding: 0.5rem 0;
    width: 100%;
}

.message-audio audio {
    width: 100%;
    max-width: 300px;
}

.message-button-container {
    margin: 0.5rem 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.message-item.message-right .message-button-container {
    align-items: flex-end;
    width: fit-content;
    margin-left: auto;
}

.conversation-button {
    background-color: #ec4899;
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    width: 100%;
    max-width: 400px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.conversation-button.button-clicked {
    background-color: #10b981 !important;
    cursor: default;
    width: fit-content;
    max-width: 400px;
    margin-left: auto;
    margin-right: 0;
    transition: background-color 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.conversation-button.button-clicked:hover {
    background-color: #10b981 !important;
}

.conversation-button:disabled {
    opacity: 1;
    cursor: default;
}

.conversation-button:disabled:hover,
.conversation-button.button-clicked:disabled:hover {
    background-color: #10b981 !important;
}

.conversation-button:hover:not(.button-clicked) {
    background-color: #db2777;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(236, 72, 153, 0.3);
}

.conversation-button:active {
    transform: translateY(0);
}

/* Responsive adjustments for conversation flow */
@media (max-width: 768px) {
    .conversation-button {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
        max-width: 100%;
    }
    
    .conversation-image {
        max-width: 100%;
    }
    
    .message-audio audio {
        max-width: 100%;
    }
}

.loading-message-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.loading-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.loading-dots {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    background-color: #2d2d2d;
    color: #e0e0e0;
    padding: 3rem 0 2rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    gap: 3rem;
}

.footer-left {
    flex: 1;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 24px;
    width: auto;
}

.footer-logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

.copyright {
    font-size: 0.875rem;
    color: #b0b0b0;
    margin-bottom: 1.5rem;
}

.footer-info {
    margin-bottom: 1.5rem;
}

.info-label {
    font-size: 0.875rem;
    color: #b0b0b0;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.875rem;
    color: #e0e0e0;
    margin-bottom: 0.75rem;
}

.footer-links-left {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-right {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.footer-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        padding: 0 1rem;
        gap: 1rem;
    }

    .brand {
        font-size: 1.25rem;
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .content-container {
        padding: 1.5rem;
        max-width: 100%;
    }

    .messages-container {
        max-height: 60vh;
        gap: 1rem;
        margin-top: 0.5rem;
    }

    .message-area {
        padding: 0.875rem;
        min-height: auto;
    }

    .cpf-title-wrapper {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .cpf-logo {
        width: 32px;
        height: 32px;
    }

    .cpf-title {
        font-size: 1.1rem;
    }

    .instruction-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .cpf-example {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }

    .cpf-form {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .cpf-input {
        flex: 1;
        padding: 0.75rem;
        font-size: 0.95rem;
        min-width: 0;
    }

    .continue-button {
        flex-shrink: 0;
        padding: 0.75rem;
        min-width: 48px;
        width: 48px;
        height: 48px;
    }

    .loading-message-wrapper {
        padding: 0.5rem;
        gap: 0.75rem;
    }

    .loading-logo {
        width: 32px;
        height: 32px;
    }

    .banner {
        margin: 0.5rem 0;
    }

    .banner-image {
        border-radius: 6px;
    }

    .footer-container {
        flex-direction: column;
        padding: 0 1rem;
        gap: 2rem;
    }

    .footer-right {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .content-container {
        padding: 1rem;
        border-radius: 8px;
    }

    .cpf-title {
        font-size: 1rem;
    }

    .instruction-text {
        font-size: 0.85rem;
    }

    .cpf-example {
        font-size: 0.8rem;
    }

    .cpf-input {
        font-size: 0.9rem;
        padding: 0.7rem;
    }

    .continue-button {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}

