:root {
    --primary-color: #ef8420; 
    --secondary-color: white; 
    --background-color: #f3f3f3; 
    --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-image: url("../images/zellbg.avif");
    background-size: cover;
    background-color: #cccccc;
}

.chat-container {
    width: 370px; /* Slightly narrower */
    height: 550px; /* Slightly shorter */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border-radius: 15px; /* More rounded */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content overflow */
    transition: all 0.3s ease-in-out;
}

.chat-container.minimized {
    height: 50px; /* Height when minimized */
    width: 200px; /* Width when minimized */
}

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

.chat-container.minimized .chat-header {
    border-radius: 15px; /* Fully rounded when minimized */
}

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

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: transparent; 
}

/* 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: 10px 15px;
    border-radius: 18px; /* More rounded messages */
    max-width: 85%;
    line-height: 1.4;
    word-wrap: break-word;
}

.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: 15px;
    font-size: 12px;
    color: #666;
    pointer-events: none;
    user-select: none;
}

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

/* Update chat-input to accommodate the new wrapper */
.chat-input {
    position: relative;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: transparent;
    border-top: 1px solid #ddd;
}

.chat-input input {
    flex: 1;
    padding: 8px 50px 8px 8px; /* Increase right padding for the counter */
    font-size: 1.0em;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.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: #efa420; /* Lighter teal on hover */
}

/* Send Icon (replace text with an SVG or icon font later) */
.chat-input button::after {
    content: '➤'; /* Simple arrow for now */
    font-size: 1.1em;
    transform: rotate(-45deg);
    margin-left: 2px;
}

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

.header-controls button {
    background: transparent;
    color: var(--secondary-color);
    border: none;
    padding: 10px;
    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 */
    padding:10px;
}

.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 .booking-elements,
.chat-container.minimized .header-controls /* Hide controls when minimized */
{
    display: none;
}

/* Existing styles for suggestions, greeting, typing indicator... */
/* You might want to adjust these colors too */
.suggested-queries {
    padding: 10px 15px;
    background: transparent;
    transition: all 0.3s ease;
}

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

.suggestion-btn {
    background: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 8px;
    font-size: 1em;
    cursor: pointer;
    color: var(--primary-color);
    text-align: left;
    white-space: pre-line;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeInFromLeft 0.5s forwards;
}

@keyframes fadeInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Add animation delay for multiple buttons */
.suggestion-btn:nth-child(1) { animation-delay: 0s; }
.suggestion-btn:nth-child(2) { animation-delay: 0.2s; }
.suggestion-btn:nth-child(3) { animation-delay: 0.4s; }
.suggestion-btn:nth-child(4) { animation-delay: 0.6s; }
.suggestion-btn:nth-child(5) { animation-delay: 0.8s; }

.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); }
}

.feedback-container {
    position: fixed;
    bottom: 20px;
    right: 400px;
    z-index: 1000;
}

.feedback-box {
    background: var(--text-light);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
}

.feedback-message {
    width: 94%;
    height: 60px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 0.9em;
    background: var(--text-light);
}

.feedback-message:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 108, 103, 0.2);
}

.feedback-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: all 0.3s ease;
    width: 100%;
}

.feedback-btn:hover {
    background: #efa420;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.feedback-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px var(--shadow-color);
}

/* Booking Elements Styles */
.booking-elements {
    position: absolute;
    bottom: 60px; /* Position above chat input */
    left: 0;
    right: 0;
    padding: 15px;
    background: transparent;
    border-radius: 8px;
    z-index: 10;
}

.date-selection input {
    width: 95%;
    padding: 8px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    font-size: 0.9em;
}

.guest-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
}

.guest-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--secondary-color);
    margin: 5px;
    padding: 5px;
    border-radius: 8px;
}

.number-input {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.number-input button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.number-input input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
}

.confirm-guests {
    margin-top: 10px;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.confirm-guests:hover {
    background: #efa420;
}

/* Flatpickr customization */
.flatpickr-calendar {
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.flatpickr-day.selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.flatpickr-day.selected:hover {
    background: #efa420 !important;
}

/* Place Selection Styles */
.place-selection {
    padding: 15px;
}

.place-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.place-btn {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95em;
    text-align: center;
    color: var(--primary-color);
}

.place-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.place-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Resort Selection Styles */
.resort-selection {
    padding: 15px;
    background: var(--secondary-color);
    border-radius: 12px;
    margin-bottom: 10px;
}

.resort-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resort-list-label {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1em;
}

.resort-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--secondary-color);
    padding: 5px;
}

.resort-list::-webkit-scrollbar {
    width: 6px;
}

.resort-list::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 3px;
}

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

.resort-item {
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
    margin: 2px 0;
    font-size: 0.95em;
}

.resort-item:hover {
    background-color: rgba(239, 132, 32, 0.1);
    border-color: var(--primary-color);
}

.resort-item.selected {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
}

.resort-item.dont-know-item {
    font-style: italic;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    padding-bottom: 15px;
}

.resort-item.dont-know-item:hover {
    background-color: rgba(239, 132, 32, 0.15);
}

.history-modal {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.history-modal-content {
    background: #fff;
    padding: 16px;
    border-radius: 8px 8px 0 0;
    max-height: 300px;
    overflow-y: auto;
    position: relative;
}

.history-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f5f5f5;
    font-size: 0.98em;
    word-break: break-word;
}

.history-message.user-message {
    background: #e6f7ff;
    text-align: right;
    background: var(--primary-color);
    color: var(--secondary-color);
}

.history-message.bot-message {
    background: #f0e6ff;
    text-align: left;
    background: var(--secondary-color);
    color: var(--primary-color);
} 

/* Location Selection Styles */
.location-selection {
    padding: 20px;
    background: var(--secondary-color);
    border-radius: 12px;
    margin-bottom: 10px;
}

.dropdown-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dropdown-group label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.dropdown-group select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--secondary-color);
    color: var(--primary-color);
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dropdown-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(239, 132, 32, 0.1);
}

.dropdown-group select:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.dropdown-group select option {
    padding: 10px;
}

.confirm-availability {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.confirm-availability:hover:not(:disabled) {
    background: #d17118;
    transform: translateY(-1px);
}

.confirm-availability:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* Unit Selection Styles */
.unit-selection {
    padding: 20px;
    background: var(--secondary-color);
    border-radius: 12px;
    margin-bottom: 10px;
}

/* Hide confirm unit button when not needed */
.unit-selection .confirm-unit[style*="display: none"] {
    display: none !important;
}

.confirm-unit {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.confirm-unit:hover:not(:disabled) {
    background: #d17118;
    transform: translateY(-1px);
}

.confirm-unit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}
