:root {
    --primary: #2E8B57;
    --primary-dark: #26734a;
    --secondary: #FF6B35;
    --accent: #4ECDC4;
    --light: #f8f9fa;
    --dark: #2C3E50;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --success: #4bb543;
    --danger: #dc3545;
    --warning: #ffc107;
    --border-radius: 16px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 90vh;
}

.header {
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.logo-container {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    z-index: 1;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.header-text {
    flex: 1;
    z-index: 1;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9fafb;
    position: relative;
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.user-message {
    align-self: flex-end;
}

.ai-message {
    align-self: flex-start;
}

.message-bubble {
    padding: 8px 18px 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    max-width: 100%;
}

.user-message .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-bubble {
    background: white;
    color: var(--dark);
    border: 1px solid var(--light-gray);
    border-bottom-left-radius: 4px;
}

.message-label {
    display: none;
}

.message-bubble::before {
    content: attr(data-sender);
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 5px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-message .message-bubble::before {
    content: "You";
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
}

.ai-message .message-bubble::before {
    content: "AnyHelpBot";
    text-align: left;
    color: var(--primary);
}

.input-area {
    padding: 20px;
    border-top: 1px solid var(--light-gray);
    background: white;
}

.input-form {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex-grow: 1;
    padding: 14px 18px;
    border: 1px solid var(--light-gray);
    border-radius: 30px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--light);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2);
}

button {
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
}

.error-box {
    background-color: #ffe6e6;
    color: var(--danger);
    border: 1px solid #ffb3b3;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.clear-button {
    background-color: var(--secondary);
    padding: 10px 18px;
    font-size: 14px;
}

.clear-button:hover {
    background-color: #e55a2b;
}

.scroll-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.scroll-indicator.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-indicator i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.auth-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
}

.auth-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
}

.auth-description {
    color: var(--gray);
    margin-bottom: 25px;
    line-height: 1.5;
}

.otp-input {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.otp-input input {
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    transition: var(--transition);
}

.otp-input input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2);
}

.auth-error {
    color: var(--danger);
    margin-bottom: 15px;
    font-weight: 500;
}

.auth-button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.whatsapp-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #25D366;
}

.whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 10px;
}

.whatsapp-button:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.cookie-consent {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-width: 500px;
    width: 90%;
    display: none;
}

.cookie-consent.active {
    display: block;
}

.cookie-consent p {
    margin-bottom: 15px;
    color: var(--dark);
}

.cookie-consent a {
    color: var(--primary);
    text-decoration: none;
}

.cookie-consent a:hover {
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-accept {
    background: var(--primary);
}

@media (max-width: 768px) {
    .app-container {
        height: 95vh;
    }
    
    .message {
        max-width: 90%;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .chat-log {
        padding: 15px;
    }
    
    .input-area {
        padding: 15px;
    }
    
    button {
        padding: 12px 18px;
    }
    
    .scroll-indicator {
        bottom: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .app-container {
        height: 97vh;
    }
    
    .message {
        max-width: 95%;
    }
    
    .otp-input input {
        width: 40px;
        height: 50px;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .scroll-indicator {
        bottom: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }
    
    .scroll-indicator i {
        font-size: 14px;
    }
}

.chat-log::-webkit-scrollbar {
    width: 6px;
}

.chat-log::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-log::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-log::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message {
    animation: fadeIn 0.3s ease;
}