/* ------------------- Enterprise Fintech Theme 2025 ------------------- */
:root {
    --primary-color: #0052cc;
    --primary-dark: #003d99;
    --brand-gradient: linear-gradient(135deg, #0052cc 0%, #0747a6 100%);
    --bg-gradient: linear-gradient(180deg, #f0f2f5 0%, #eef0f5 100%);
    --text-primary: #172b4d;
    --text-secondary: #5e6c84;
    --success-color: #36b37e;
    --border-color: #dfe1e6;
    --bg-white: #ffffff;
    --radius-xl: 20px;
    --radius-lg: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 4px rgba(9, 30, 66, 0.08);
    --shadow-md: 0 4px 8px rgba(9, 30, 66, 0.12);
    --shadow-lg: 0 12px 24px rgba(9, 30, 66, 0.15);
    --font-family: 'Inter', sans-serif;
    --header-height: 70px;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    overflow: hidden;
}

/* ------------------- Boot Animation ------------------- */
.boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

/* ------------------- Header ------------------- */
.chat-container::before {
    content: " Cashlink Connect";
    font-weight: 600;
    font-size: 18px;
    text-align: center;
    color: #fff;
    background: linear-gradient(90deg, #007bff, #00bcd4);
    padding: 15px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.boot-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-content {
    text-align: center;
    color: white;
}

/* Logo Circle - Lottie */
.logo-circle {
    width: 150px;
    height: 150px;
    background: transparent;
    margin: 0 auto 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: logoPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.boot-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    letter-spacing: -0.5px;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: var(--success-color);
    animation: loadBar 1.5s ease-in-out 0.9s forwards;
    box-shadow: 0 0 10px var(--success-color);
}

.boot-status {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.2s forwards;
}

@keyframes logoPop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes loadBar {
    0% {
        width: 0%;
    }

    50% {
        width: 60%;
    }

    100% {
        width: 100%;
    }
}

/* ------------------- Layout ------------------- */
.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-widget {
    width: 420px;
    height: 750px;
    max-height: 100%;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.chat-header {
    height: var(--header-height);
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Status Dot in Header */
.avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(54, 179, 126, 0.5);
    z-index: 10;
}

.header-text h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Chat Area & Messages */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f9f9fb;
}

.chat-area::-webkit-scrollbar {
    width: 6px;
}

.chat-area::-webkit-scrollbar-thumb {
    background: #d0d7e5;
    border-radius: 10px;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
    animation: msgIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-wrapper.bot {
    align-self: flex-start;
}

.message-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message-bubble {
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.5;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.message-bubble>*:first-child {
    margin-top: 0;
}

.message-bubble>*:last-child {
    margin-bottom: 0;
}

.message-bubble p {
    margin: 0 0 8px 0;
}

.message-bubble ul,
.message-bubble ol {
    margin: 0 0 8px 0;
    padding-left: 20px;
}

.message-wrapper.bot .message-bubble {
    background: white;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.message-wrapper.user .message-bubble {
    background: var(--brand-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.time-stamp {
    font-size: 10px;
    color: #97a0af;
    margin: 0 4px;
    opacity: 0;
    transition: opacity 0.2s;
    height: 0;
    overflow: hidden;
}

.message-wrapper:hover .time-stamp {
    opacity: 1;
    height: auto;
    margin-top: 2px;
}

.message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chat-action-chip {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    animation: chipIn 0.4s ease backwards;
}

@keyframes chipIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-action-chip:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Input */
.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
}

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

#textInput {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    border: 2px solid #ebecf0;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #f9f9fb;
}

#textInput:focus {
    border-color: var(--primary-color);
    background: white;
}

#sendBtn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

#sendBtn:disabled {
    background: #ebecf0;
    color: #a5adba;
    cursor: not-allowed;
    box-shadow: none;
}

#sendBtn:not(:disabled):hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.branding {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Suggestions */
.suggestions-list {
    position: absolute;
    bottom: 90px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
}

.suggestions-list.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    font-size: 14px;
}

.suggestion-item:hover {
    background: #f7f8fa;
    color: var(--primary-color);
}

/* Typing & Interactive Elements */
.typing-bubble {
    padding: 12px 20px !important;
    display: flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

.dot {
    width: 6px;
    height: 6px;
    background: #8993a4;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Forms */
.contact-form,
.career-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 260px;
}

.contact-form input,
select,
textarea {
    padding: 12px;
    border: 1px solid #dfe1e6;
    border-radius: 10px;
    font-size: 14px;
    width: 100%;
    background: #fdfdfd;
}

.contact-form button,
.chat-button {
    margin-top: 8px;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.contact-form button:hover,
.chat-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

input[type="file"]::file-selector-button {
    background: #f1f2f4;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    margin-right: 12px;
    font-weight: 500;
}

input[type="file"]::file-selector-button:hover {
    background: #dfe1e6;
}

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

.contact-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        padding: 0;
    }

    .chat-widget {
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .chat-header {
        border-radius: 0;
    }
}
