:root {
    --bg-color: #050508;
    --primary: #00d2ff;
    --secondary: #3a7bd5;
    --accent: #b92b27;
    --glass-bg: rgba(15, 15, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f0f5;
    --text-secondary: #9aa0a6;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100dvh;
    width: 100vw;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#mycelium-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.glass-overlay {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 800px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeIn 1.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.split-layout {
    max-width: 1200px;
    display: flex;
    flex-direction: row;
    padding: 0;
    overflow: hidden;
}

.chat-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
}

.form-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
}

.review-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}
.review-scroll-area::-webkit-scrollbar {
    width: 6px;
}
.review-scroll-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}
.review-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.review-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.step {
    display: none;
    animation: fadeIn 0.5s forwards;
}
.step.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}
.form-group label {
    display: block;
    color: #d0d0e0;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}
.form-group input, .form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}
.error-message {
    color: #ff6b6b;
    margin-top: 10px;
    font-size: 0.9rem;
    display: none;
}
.success-state {
    text-align: center;
    padding: 40px 0;
}

button.submit-btn {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    height: auto;
    transition: all 0.3s;
    margin-top: 10px;
}
button.submit-btn:hover {
    background: rgba(0, 210, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
    transform: none;
}

.header {
    text-align: center;
    padding: 30px;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.review-link {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #a0a0b0;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.review-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.review-link svg {
    width: 14px;
    height: 14px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.header h1 span {
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
    font-weight: 300;
}

.header .subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
}

.messages-area {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
    padding-right: 10px;
}

/* Custom Scrollbar */
.messages-area::-webkit-scrollbar {
    width: 6px;
}
.messages-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.messages-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-content {
    padding: 14px 20px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.95rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

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

.user-message .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ai-message {
    align-self: flex-start;
}

.ai-message .message-content {
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.input-container {
    display: flex;
    margin-top: auto;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 6px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-container:focus-within {
    border-color: rgba(0, 210, 255, 0.5);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 0 15px rgba(0, 210, 255, 0.2);
}

input[type="text"] {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    padding: 10px 20px;
    outline: none;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
}

button.chip {
    width: auto !important;
    height: auto !important;
    border-radius: 20px !important;
    white-space: nowrap;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.6);
}

button:active {
    transform: scale(0.95);
}

.send-icon {
    width: 20px;
    height: 20px;
    margin-right: 2px;
    margin-top: 2px;
}

.loading-dots {
    display: flex;
    gap: 4px;
    padding: 10px 0;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 800px) {
    .glass-overlay {
        width: 100%;
        height: 100dvh;
        border-radius: 0;
        border: none;
    }
    
    .split-layout {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .chat-column {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        min-height: 50vh;
    }
    
    .form-column {
        min-height: 60vh;
    }
}
