:root {
    --primary-color: #2c6c67; /* Dark Teal */
    --secondary-color: #ffd44d; /* Gold */
    --background-color: #f8f9fa; /* Light Gray */
    --text-light: #ffffff;
    --text-dark: #343a40;
    --border-color: #dee2e6;
    --shadow-color: rgba(0,0,0,0.1);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-size: cover;
}

.chat-container {
    width: 370px; /* Slightly narrower */
    height: 550px; /* Slightly shorter */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-light);
    border-radius: 15px; /* More rounded */
    box-shadow: 0 5px 15px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content overflow */
    transition: all 0.3s ease-in-out;
    z-index: 1000;
    font-size: 1.1em; /* Slightly larger base font for all chat */
}

.chat-container.minimized {
    height: 50px;
    width: 200px;
    border-radius: 15px;
    background: var(--text-light);
    position: fixed;
    bottom: 20px;
    right: 20px;
    box-shadow: 0 5px 15px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-container.minimized .chat-header {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    background: var(--primary-color);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
}

.chat-header {
    background: var(--primary-color);
    color: var(--secondary-color); /* Gold text on teal */
    padding: 12px 15px; /* Adjusted padding */
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer; /* Indicate it's clickable for minimize/maximize */
}

.chat-header span { /* Style for title */
    font-weight: bold;
    font-size: 1.1em;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: var(--background-color); /* Light background for messages */
    border-bottom: 1px solid var(--border-color);
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--background-color);
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

.message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 18px; /* More rounded messages */
    max-width: 90%;
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 0.95em; /* Smaller, more compact for desktop */
}

.user-message {
    background: var(--primary-color);
    color: var(--secondary-color);
    margin-left: auto;
    border-bottom-right-radius: 5px; /* Tail effect */
}

.bot-message {
    background: var(--secondary-color);
    color: var(--primary-color);
    margin-right: auto;
    border-bottom-left-radius: 5px; /* Tail effect */
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.char-counter {
    position: absolute;
    right: 10px;
    font-size: 12px;
    color: #666;
    pointer-events: none;
    user-select: none;
}

.char-counter.near-limit {
    color: #ff4444;
}

.chat-input {
    display: flex;
    padding: 8px;
    border-top: 1px solid #ddd;
    background: #fff;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 8px 35px 8px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    font-size: 1em; /* Standard desktop input size */
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 108, 103, 0.2); /* Focus ring */
}

.chat-input button {
    padding: 10px 15px;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 50%; /* Circle button */
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex; /* Center icon */
    align-items: center;
    justify-content: center;
}

.chat-input button:hover {
    background: #2c8c77; /* Lighter teal on hover */
}

/* Send Icon (SVG paper airplane, modern outlined style) */
.chat-input button::after {
    content: '';
    display: inline-block;
    width: 1.0em;
    height: 1.0em;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 10L18 2L11 19L9 13L2 10Z" fill="white" stroke="white" stroke-width="1.5" stroke-linejoin="round"/></svg>') no-repeat center center;
    background-size: contain;
    margin-left: 2px;
    vertical-align: middle;
    /* SVG is a paper airplanen */
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-controls button {
    background: transparent;
    color: var(--secondary-color);
    border: none;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.header-controls button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.restart-btn {
    color: #ffdddd; /* Light red for restart */
    font-size: 1em;
}

.restart-btn:hover {
    background-color: rgba(220, 53, 69, 0.7); /* Semi-transparent red */
}

.minimize-btn {
    font-weight: bold;
}

/* Remove default list styling if not needed */
.formatted-list {
    list-style-type: none;
    padding-left: 0;
}

.formatted-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.formatted-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.formatted-text a {
    color: var(--primary-color); /* Make links match theme */
    text-decoration: underline;
}

.formatted-text a:hover {
    text-decoration: none;
}

/* Hide suggestions/typing indicator when minimized */
.chat-container.minimized .suggested-queries,
.chat-container.minimized .chat-input,
.chat-container.minimized .chat-messages,
.chat-container.minimized .header-controls /* Hide controls when minimized */
{
    display: none;
}

/* Existing styles for suggestions, greeting, typing indicator... */
.suggested-queries {
    padding: 10px 15px;
    background: #f1f3f5;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.query-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.suggestion-btn {
    background: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 5px 12px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--primary-color);
}

.suggestion-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.greeting-message {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 0.9em;
}

.typing-indicator {
    display: none;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 18px;
    background: var(--secondary-color);
    color: var(--primary-color);
    width: fit-content;
    font-size: 0.9em;
}

.typing-dots {
    display: inline-block;
    margin-left: 5px;
}

.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-right: 3px;
    animation: typing 1.4s infinite ease-in-out both;
}

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

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

/* Mobile-specific styles */
@media screen and (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        transition: all 0.3s ease-in-out;
    }

    .chat-container.minimized {
        width: 120px;
        height: 60px;
        bottom: 20px;
        right: 20px;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .chat-container.minimized .chat-header {
        border-radius: 50%;
        padding: 0;
        justify-content: center;
        align-items: center;
    }


    .chat-container.minimized .header-controls {
        display: none;
    }

    .chat-messages {
        padding: 10px;
    }

    .message {
        max-width: 90%;
        padding: 8px 12px;
        font-size: 1.2em; /* Larger message text on mobile */
    }

    .chat-input {
        padding: 8px;
    }

    .chat-input input {
        padding: 8px 35px 8px 8px;
        font-size: 18px !important; /* Large enough for mobile, prevents zoom */
    }

    .chat-input input::placeholder {
        font-size: 1em !important; /* Ensures placeholder is also readable */
    }

    .suggestion-btn {
        font-size: 1.1em;
        padding: 12px 20px;
    }

    .typing-indicator {
        font-size: 1.2em;
        padding: 12px 16px;
    }

    .restart-btn {
        font-size: 1.2em;
        padding: 10px 18px;
    }
}

.chat-container.minimized .suggested-queries {
    display: none !important;
}

.chat-container.minimized .chat-messages,
.chat-container.minimized .chat-input,
.chat-container.minimized .header-controls {
    display: none !important;
}

@media screen and (max-width: 768px) {
    .message {
        font-size: 1.2em;
    }
    .chat-input input {
        font-size: 18px !important; /* Large enough for mobile, prevents zoom */
    }
    .chat-input input::placeholder {
        font-size: 1em !important; /* Ensures placeholder is also readable */
    }
    .suggestion-btn {
        font-size: 1.1em;
        padding: 12px 20px;
    }
    .typing-indicator {
        font-size: 1.2em;
        padding: 12px 16px;
    }
    .restart-btn {
        font-size: 1.2em;
        padding: 10px 18px;
    }
} 