:root {
    --primary-color: #5F8D4E;
    --secondary-color: #285430;
    --accent-color: #A4BE7B;
    --text-color: #333;
    --bg-color: #ffffff;
    --glass-color: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(200, 200, 200, 0.5);
    --chat-user: rgba(224, 242, 254, 0.95);
    --chat-ai: rgba(220, 252, 231, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* 3D scene container takes up the full viewport */
#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

.content-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    height: 100vh;
    box-sizing: border-box;
    pointer-events: none; /* Let clicks pass through to the 3D scene */
}

/* Make all interactive elements have pointer events */
.welcome-message, .glass-container, .chat-container, .input-container, .input-field, .send-button, .message {
    pointer-events: auto;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 350px;
    width: 100%;
    position: absolute;
    right: 20px;
    bottom: 20px;
}

.input-field {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(95, 141, 78, 0.2);
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--accent-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.loading-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.loading-progress {
    font-size: 18px;
    color: var(--secondary-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glass Container for Chat */
.glass-container {
    background: var(--glass-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    border-radius: 20px;
    padding: 20px;
    max-width: 350px;
    width: 100%;
    box-sizing: border-box;
    position: absolute;
    right: 20px;
    bottom: 90px;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.glass-container:hover {
    opacity: 1;
}

/* Collapsible UI */
.glass-container.collapsed {
    transform: translateX(calc(100% - 60px));
}

.toggle-chat {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    border: none;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Welcome message */
.welcome-message {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    animation: floatUp 0.5s ease-out;
    max-width: 350px;
    width: 100%;
    box-sizing: border-box;
    position: absolute;
    left: 20px;
    top: 20px;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.welcome-message:hover {
    opacity: 1;
}

.welcome-message.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.close-welcome {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    border: none;
}

.welcome-title {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: bold;
}

.welcome-text {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* Improved Chat Container */
.chat-container {
    background: transparent;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
    padding-right: 10px;
}

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

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 20px;
    border: 2px solid transparent;
}

/* Message styling with fading effect for older messages */
.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease;
    opacity: 0.6;
}

/* Progressively increase opacity for more recent messages */
.message:nth-last-child(1) {
    opacity: 1;
}

.message:nth-last-child(2) {
    opacity: 0.9;
}

.message:nth-last-child(3) {
    opacity: 0.8;
}

.message:nth-last-child(4) {
    opacity: 0.7;
}

.user-message {
    background-color: var(--accent-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

/* Gradient button */
.send-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.send-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    .glass-container {
        max-width: 300px;
        right: 10px;
        bottom: 80px;
        padding: 15px;
    }
    
    .welcome-message {
        max-width: 300px;
        left: 10px;
        top: 10px;
        padding: 12px 15px;
    }
    
    .input-container {
        max-width: 300px;
        right: 10px;
        bottom: 10px;
    }
} 