@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
    --c-gray-900: #000000;
    --c-gray-800: #1f1f1f;
    --c-gray-700: #2e2e2e;
    --c-gray-600: #313131;
    --c-gray-500: #969593;
    --c-gray-400: #a6a6a6;
    --c-gray-300: #bdbbb7;
    --c-gray-200: #f1f1f1;
    --c-gray-100: #ffffff;
    --c-green-500: #45ffbc;
    --c-olive-500: #e3ffa8;
    --c-blue-500: #4a90e2;
    --c-purple-500: #9b59b6;
    --c-red-500: #e74c3c;
    --c-white: var(--c-gray-100);
    --c-text-primary: var(--c-gray-100);
    --c-text-secondary: var(--c-gray-200);
    --c-text-tertiary: var(--c-gray-500);
}

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

body {
    font-family: "Be Vietnam Pro", sans-serif;
    background-color: var(--c-gray-900);
    color: var(--c-text-primary);
    line-height: 1.5;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
}

/* Main Container */
.app {
    background-color: var(--c-gray-800);
    height: 100vh;
    width: 95%;
    max-width: 1600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
}

/* Header */
.app-header {
    background-color: var(--c-gray-700);
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.app-header h1 {
    font-size: 1.5rem;
}

/* Main Body Layout */
.app-body {
    display: flex;
    gap: 1rem;
    flex-grow: 1;
    height: calc(100% - 4.5rem); /* Adjust for header height */
    overflow: hidden; /* Prevents overflow from expanding the body */
}

/* Panels */
.chatbot-panel, .dashboard-panel {
    flex: 1;
    background-color: var(--c-gray-700);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%; /* Matches app-body height */
}

/* Chatbot Styles */
.chatbot {
    display: flex;
    flex-direction: column;
    height: 100%; /* Fills chatbot-panel */
}

.chatbot h2 {
    margin-bottom: 1rem;
    color: var(--c-text-primary);
}

/* Wrapper for chat history */
.chat-history-wrapper {
    flex-grow: 1; /* Takes available space between h2 and form */
    overflow: hidden; /* Constrains content */
}

/* Chat history (scrollable area) */
.chat-history {
    height: 100%; /* Matches wrapper height */
    overflow-y: auto; /* Enables vertical scrolling */
    padding: 1.5rem;
    background-color: var(--c-gray-600);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    max-width: 80%;
}

.message-user {
    background-color: var(--c-gray-500);
    color: var(--c-text-primary);
    align-self: flex-end;
}

.message-bot {
    background-color: var(--c-gray-600);
    color: var(--c-text-primary);
    align-self: flex-start;
}

/* Loader Styles */
.message-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--c-gray-600);
    padding: 0.75rem;
    border-radius: 12px;
    max-width: 80%;
    align-self: flex-start;
}

#container {
    display: inline-block;
    width: 44px;
    height: 44px;
    position: relative;
}

.circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: wave 1.8s ease-in infinite;
}

.circle:nth-child(1) { width: 8px; height: 8px; top: 18px; left: 18px; animation-delay: 0.1s; }
.circle:nth-child(2) { width: 16px; height: 16px; top: 14px; left: 14px; animation-delay: 0.2s; }
.circle:nth-child(3) { width: 24px; height: 24px; top: 10px; left: 10px; animation-delay: 0.3s; }
.circle:nth-child(4) { width: 32px; height: 32px; top: 6px; left: 6px; animation-delay: 0.4s; }
.circle:nth-child(5) { width: 40px; height: 40px; top: 2px; left: 2px; animation-delay: 0.5s; }

@keyframes wave {
    0% { transform: scale(1); }
    10% { transform: scale(1.3); border-color: var(--c-gray-300); }
    20% { transform: scale(1); }
    40% { transform: scale(1); border-color: transparent; }
    100% { transform: scale(1); border-color: transparent; }
}

.chat-input {
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex-grow: 1;
    padding: 0.75rem;
    background-color: var(--c-gray-600);
    color: var(--c-text-primary);
    border: 1px solid var(--c-gray-500);
    border-radius: 8px 0 0 8px;
}

.chat-input button {
    padding: 0.75rem 1.5rem;
    background-color: var(--c-blue-500);
    color: var(--c-white);
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-input button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

/* Dashboard Styles */
.app-body-main-content {
    flex-grow: 1;
}

/* Service Section */
.service-section {
    margin-bottom: 2.5rem;
}

.service-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.service-section-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.search-field {
    display: flex;
    flex-grow: 1;
    position: relative;
}

.search-field input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2rem;
    background-color: var(--c-gray-600);
    color: var(--c-text-primary);
    border: 1px solid var(--c-gray-500);
    border-radius: 8px;
}

.search-field i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

.dropdown-field {
    position: relative;
    flex-grow: 1;
}

.dropdown-field select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--c-gray-600);
    color: var(--c-text-primary);
    border: 1px solid var(--c-gray-500);
    border-radius: 8px;
    appearance: none;
}

.dropdown-field i {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

.flat-button {
    border-radius: 8px;
    background-color: var(--c-green-500);
    padding: 0.75rem 1.5rem;
    border: none;
    color: var(--c-gray-900);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.flat-button:hover {
    background-color: #3ad9a3;
    transform: translateY(-2px);
}

.mobile-only {
    display: none;
}

@media (max-width: 1000px) {
    .service-section-header {
        display: none;
    }
    .mobile-only {
        display: block;
        margin-bottom: 1rem;
    }
}

.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.tile {
    padding: 1rem;
    border-radius: 8px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.25s ease;
}

.tile.electricity {
    background-color: var(--c-olive-500);
    color: var(--c-gray-900);
}

.tile.water {
    background-color: var(--c-blue-500);
    color: var(--c-white);
}

.tile.internet {
    background-color: var(--c-purple-500);
    color: var(--c-white);
}

.tile:hover {
    transform: translateY(-5px);
}

.tile-header {
    display: flex;
    align-items: center;
}

.tile-header i {
    font-size: 2em;
}

.tile-header h3 {
    margin-left: 0.5rem;
    display: flex;
    flex-direction: column;
}

.tile-header h3 span:first-child {
    font-weight: 600;
}

.tile-header h3 span:last-child {
    font-size: 0.875rem;
    color: var(--c-text-tertiary);
}

.tile a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

/* Transfer Section */
.transfer-section h2 {
    font-size: 1.5rem;
}

.transfer-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--c-gray-500);
    margin-bottom: 1rem;
}

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

.filter-options p {
    color: var(--c-text-tertiary);
}

.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: var(--c-gray-500);
    color: var(--c-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.icon-button:hover {
    background-color: var(--c-gray-400);
    transform: translateY(-2px);
}

.transfers {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.transfer {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
}

.transfer.apple {
    background-color: var(--c-gray-600);
}

.transfer.pinterest {
    background-color: var(--c-red-500);
    color: var(--c-white);
}

.transfer.warner {
    background-color: var(--c-purple-500);
    color: var(--c-white);
}

.transfer-logo {
    width: 42px;
    height: 42px;
    background-color: var(--c-gray-200);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transfer-logo img {
    width: 50%;
}

.transfer-details {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    margin-left: 1.5rem;
}

.transfer-details div {
    width: 33%;
}

.transfer-details dt {
    font-weight: 600;
}

.transfer-details dd {
    color: var(--c-text-tertiary);
    margin-top: 0.25rem;
}

.transfer-number {
    margin-left: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-body {
        flex-direction: column;
    }
    .chatbot-panel, .dashboard-panel {
        width: 100%;
    }
    .tiles {
        grid-template-columns: 1fr;
    }
    .transfer-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    .transfer-details div {
        width: 100%;
    }
    .transfer-number {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Focus styles */
input,
select,
button,
a {
    &:focus {
        outline: 0;
        box-shadow: 0 0 0 2px var(--c-gray-800), 0 0 0 4px var(--c-gray-300);
    }
}