/* styles/nature-theme.css - Global Mystical Forest Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #0a0f0c;
    --bg-glass: rgba(20, 31, 23, 0.6);
    --bg-card: rgba(28, 43, 33, 0.5);
    --primary: #4ade80; /* Nature green */
    --primary-glow: #22c55e;
    --text-main: #f0fdf4;
    --text-muted: #86efac;
    --border-glass: rgba(74, 222, 128, 0.15);
    --accent: #facc15;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(74, 222, 128, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(34, 197, 94, 0.08), transparent 25%);
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow */
.ambient-light {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    background: 
        radial-gradient(circle at top right, rgba(74,222,128,0.1) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(234,179,8,0.05) 0%, transparent 40%);
}

/* Layout for Centered Forms (Login/Signup) */
.center-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 2rem;
    z-index: 10;
}

.nature-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
}

.nature-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(74, 222, 128, 0.05);
}

/* Forms */
.nature-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nature-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: rgba(10, 15, 12, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.nature-input::placeholder { color: rgba(134, 239, 172, 0.5); }
.nature-input:focus {
    border-color: var(--primary);
    background: rgba(74, 222, 128, 0.05);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.nature-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-glow));
    border: none;
    border-radius: 20px;
    color: var(--bg-base);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    margin-top: 1rem;
}

.nature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(74, 222, 128, 0.4);
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
}
.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}
.auth-switch a:hover {
    color: var(--text-main);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    min-height: 20px;
    text-align: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- CHAT SPECIFIC STYLES --- */
.chat-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    padding: 2rem;
    margin: 0 auto;
}

/* Topbar for chat */
.chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-glass);
    padding: 1rem 2rem;
    border-radius: 30px;
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.chat-room-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(20, 31, 23, 0.4);
}
.chat-header h2 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.chat-header p { color: var(--text-muted); font-size: 0.9rem; }

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-form {
    padding: 1.5rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(10, 15, 12, 0.6);
    display: flex;
    gap: 1rem;
}

.chat-form .nature-input {
    border-radius: 30px;
    padding: 1rem 1.5rem;
}

.chat-form .nature-btn {
    width: auto;
    padding: 0 2rem;
    margin-top: 0;
    border-radius: 30px;
}

/* Messages bubbles generated by chat.js */
.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message.mine { align-self: flex-end; }
.message.other { align-self: flex-start; }

.message-inner {
    padding: 1rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-main);
}

/* My messages: Green glow */
.message.mine .message-inner {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-bottom-right-radius: 5px; /* Organic leaf tip */
}

/* Other messages: Glassmorphism */
.message.other .message-inner {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 5px;
}

.message-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.message.mine .message-meta { text-align: right; }

.message.system {
    align-self: center;
    color: var(--primary);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 20px;
    border: 1px dashed rgba(74, 222, 128, 0.3);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .chat-layout { padding: 1rem; }
    .chat-topbar { 
        flex-direction: column; 
        gap: 1rem; 
        padding: 1rem; 
        text-align: center;
    }
    .chat-form { 
        flex-direction: column; 
    }
    .chat-form .nature-btn { 
        width: 100%; 
        padding: 1rem;
        margin-top: 0.5rem;
    }
    .message { max-width: 85%; }
}

