@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-green: #27a736;
    --primary-blue: #203143;
    --bg-color: #f5f7fa;
    --surface-color: #ffffff;
    --text-primary: #2c323f;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   LOGIN PAGE (Inspired by PayPal)
   ========================================= */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 20px;
}

.login-card {
    background: var(--surface-color);
    width: 100%;
    max-width: 460px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 40px;
    text-align: center;
}

.brand-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 30px;
    letter-spacing: -1px;
}

.brand-logo span {
    color: var(--primary-green);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.login-card p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-btn:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.google-btn img {
    width: 20px;
}

/* =========================================
   CHAT PLATFORM
   ========================================= */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.sidebar-brand span {
    color: var(--primary-green);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: background 0.2s;
    gap: 12px;
}

.sidebar-item:hover,
.sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 4px solid var(--primary-green);
}

.user-profile {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-level {
    font-size: 0.75rem;
    color: var(--primary-green);
}

.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    position: relative;
}

.chat-header {
    height: 70px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.chat-title {
    font-weight: 600;
    color: var(--primary-blue);
}

.chat-box {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-color);
}

.message {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
}

.message-ai {
    background-color: white;
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.message-user {
    background-color: var(--primary-blue);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 4px rgba(32, 49, 67, 0.1);
}

.input-area {
    padding: 20px 24px;
    background-color: white;
    border-top: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border-radius: 30px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    gap: 12px;
}

.input-container input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px;
    font-size: 0.95rem;
    outline: none;
    color: var(--text-primary);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-blue);
}

.btn-send {
    background-color: var(--primary-green);
    color: white;
}

.btn-send:hover {
    background-color: #21902f;
    color: white;
}

/* Modal styles for initial assessment */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(32, 49, 67, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.modal-content p {
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover {
    background-color: #21902f;
    box-shadow: 0 4px 10px rgba(39, 167, 54, 0.3);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 100;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle-btn {
        display: block !important;
    }
}

.recording-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* =========================================
   LOADING OVERLAY
   ========================================= */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(32, 49, 67, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.global-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.global-loader img {
    height: 250px;
    animation: blink-logo 1.5s infinite alternate ease-in-out;
}

@keyframes blink-logo {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}