/* ====================
   Global Styles
======================= */
:root {
    --primary-color: #2e7d32;
    --primary-light: #60ad5e;
    --primary-dark: #005005;
    --secondary-color: #ffb300;
    --text-color: #333;
    --text-light: #6c757d;
    --background-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #4caf50;
    --info-color: #2196f3;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --border-radius: 10px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    background-image: url('/static/background_forest.jpg');
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    transition: background-image var(--transition-speed) ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

body[data-background="forest_clearing"] {
    background-image: url('/static/background_forest.jpg');
}

body[data-background="sunlight"] {
    background-image: url('https://pixabay.com/get/gc24b50a2c826ef630b67953a67195bb02d95df7bb7515dc7d1366028490acaf830278d7d39f0c3fbe50b3df12b06a4ec6ba8ef50addae18694e1b0d92bbb5db3_1280.jpg');
}

body[data-background="peaceful"] {
    background-image: url('https://pixabay.com/get/ga4f8db3ab26f3b6f94f9909d7ea2fab22a99a45418b86c0f40b8a887959c62b459b9b2383bb2be5d9da07252be4ceefd73f4bd3a8c647fdc0c766e08139f6280_1280.jpg');
}

body[data-background="kitti_forest"] {
    background-image: url('/static/background_forest.jpg');
}

/* Light Window special style */
body.light-window-body {
    background-image: url('../assets/light_window_bg.svg');
    background-size: cover;
    background-attachment: fixed;
}

.light-window-body .navbar {
    background-color: rgba(77, 57, 133, 0.8);
}

.light-window-body .light-window-container {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
}

.light-window-body .send-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(111, 191, 115, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--primary-dark);
}

.btn {
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
    font-weight: 500;
}

.btn-success {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 4px 8px var(--shadow-color);
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
}

.card-header {
    background-color: rgba(46, 125, 50, 0.1);
    border-bottom: 1px solid rgba(46, 125, 50, 0.2);
}

.form-control {
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 10px 15px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25);
}

/* Light effect animation */
.light-effect {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: all 4s ease-in-out;
}

/* Navbar styles */
.navbar {
    background-color: rgba(46, 125, 50, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-bottom: 30px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

/* Footer styles */
.footer {
    margin-top: 3rem;
    padding: 1rem 0;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ====================
   Welcome Screen
======================= */
.welcome-screen {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.welcome-content {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.welcome-screen h1 {
    color: var(--primary-dark);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.login-card {
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
}

.about-card {
    background-color: rgba(255, 255, 255, 0.9);
}

.peticio-link {
    margin-top: 30px;
}

/* ====================
   Forest Screen
======================= */
.forest-container {
    text-align: center;
    padding: 20px;
}

.tree-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.tree-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.tree-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
}

.tree-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    color: var(--tree-color, #4CAF50);
    transition: transform 0.3s ease;
}

.tree-card:hover .tree-svg {
    transform: scale(1.05);
}

.tree-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tree-info h3 {
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.tree-info p {
    color: var(--text-light);
    margin-bottom: 15px;
    flex: 1;
}

/* ====================
   Chat Screen
======================= */
.chat-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    overflow: hidden;
}

.chat-header {
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
}

.chat-header h2 {
    margin: 0 0 0 20px;
    color: white;
    font-size: 1.5rem;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    margin-bottom: 10px;
}

.message-user {
    align-self: flex-end;
    background-color: #dcf8c6;
    border-bottom-right-radius: 5px;
}

.message-ai {
    align-self: flex-start;
    background-color: #f1f0f0;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-light);
    position: absolute;
    bottom: -18px;
}

.message-user .message-time {
    right: 5px;
}

.message-ai .message-time {
    left: 5px;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background-color: white;
}

.chat-input-container form {
    display: flex;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#chat-form button {
    border-radius: 30px;
    padding: 8px 20px;
    margin-left: 8px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-light);
    border-radius: 50%;
    margin: 0 3px;
    opacity: 0.6;
    animation: typing-animation 1.5s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-animation {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* ====================
   History Screen
======================= */
.history-container {
    padding: 20px;
}

.conversation-list {
    max-height: 600px;
    overflow-y: auto;
}

.entity-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.conversation-details {
    height: 100%;
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* ====================
   Settings Screen
======================= */
.settings-container {
    padding:
