/* app/static/css/main.css */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #f8f9fa;
    padding-top: 56px; /* Add padding to account for fixed navbar */
}

/* Make navbar fixed at top */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030; /* Ensure navbar stays on top of other content */
}

/* Navbar */
.navbar-brand {
    font-weight: 700;
}

.profile-pic-small {
    width: 25px;
    height: 25px;
    object-fit: cover;
}

/* Section Titles */
.section-title {
    font-weight: 600;
    color: #333;
    position: relative;
}

/* Cards */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Listing Cards */
.listing-thumbnail {
    height: 200px;
    object-fit: cover;
}

/* Listing View */
.listing-image {
    max-height: 500px;
    object-fit: contain;
}

.carousel-item {
    background-color: #f0f0f0;
}

.thumbnail-nav {
    cursor: pointer;
    transition: opacity 0.2s;
}

.thumbnail-nav:hover {
    opacity: 0.7;
}

/* Feature Icons */
.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
.footer {
    margin-top: 3rem;
}

/* Social Icons */
.social-icons a {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    transition: color 0.2s;
}

.social-icons a:hover {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Rating Stars */
.rating {
    color: #ffc107;
}

/* Helper Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Form Styling */
.form-control:focus,
.form-select:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.25);
}

/* Buttons */
.btn {
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #212529;
    border-color: #212529;
}

.btn-primary:hover {
    background-color: #343a40;
    border-color: #343a40;
}

.btn-success {
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .listing-thumbnail {
        height: 150px;
    }

    .listing-image {
        max-height: 300px;
    }
}

/* Search Form */
.search-form .form-control,
.search-form .form-select {
    margin-bottom: 0.5rem;
}

/* Message Conversation */
.message-bubble {
    border-radius: 1rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    max-width: 75%;
}

.message-sender {
    background-color: #212529;
    color: white;
    margin-left: auto;
}

.message-recipient {
    background-color: #f0f0f0;
    color: #333;
}

/* Helper utilities */
.nl2br {
    white-space: pre-line;
}

/* Pagination */
.pagination .page-item.active .page-link {
    background-color: #212529;
    border-color: #212529;
}

.pagination .page-link {
    color: #212529;
}

/* Small/Recent listings */
.small-listing-thumbnail {
    height: 100px;
    object-fit: cover;
}

.small-listing .card-body {
    min-height: auto;
}

/* Feedback button styles */
.feedback-btn-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1030;
}

.feedback-btn {
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.feedback-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.feedback-text {
    margin-left: 8px;
    display: none;
}

.feedback-btn:hover .feedback-text {
    display: inline;
}

@media (max-width: 576px) {
    .feedback-btn-container {
        bottom: 10px;
        right: 10px;
    }

    .feedback-btn {
        padding: 8px;
    }

    .feedback-text {
        display: none;
    }
}

/* Cookie Consent Styles */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(33, 37, 41, 0.95);
    color: #fff;
    padding: 1rem;
    z-index: 1100; /* Higher z-index to ensure it's above dimmed content */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

/* Dimming effect for page content */
main.container {
    transition: opacity 0.3s ease, pointer-events 0.3s ease;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.cookie-text {
    flex: 1 1 500px;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: space-between;
    }
}

/* AI Chat Widget Styles */
.ai-chat-container {
    position: fixed;
    bottom: 30px;
    left: 30px;  /* Changed from right: 30px to left: 30px */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;  /* Changed from flex-end to flex-start */
}

.ai-chat-toggle {
    border-radius: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    transition: transform 0.2s;
}

.ai-chat-toggle:hover {
    transform: translateY(-3px);
}

.ai-chat-widget {
    position: absolute;
    bottom: 70px;
    left: 0;  /* Changed from right: 0 to left: 0 */
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-chat-widget.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.ai-chat-header {
    background-color: #212529;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-break: break-word;
}

.user-message {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.assistant-message {
    background-color: #f8f9fa;
    border-left: 3px solid #212529;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e9ecef;
}

.ai-chat-input input {
    flex: 1;
    border-radius: 20px;
    padding-left: 15px;
}

.ai-chat-input button {
    margin-left: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation for messages */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message {
    animation: messageSlideIn 0.3s ease forwards;
}

/* Loading indicator when waiting for AI response */
.typing-indicator {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #212529;
    border-radius: 50%;
    margin: 0 2px;
    opacity: 0.6;
    animation: typingAnimation 1.5s infinite ease-in-out;
}

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

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

@keyframes typingAnimation {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Add responsive adjustments */
@media (max-width: 576px) {
    .ai-chat-widget {
        width: 300px;
        left: 10px;  /* Changed from right: 10px to left: 10px */
        bottom: 60px;
    }

    .ai-chat-toggle {
        left: 10px;  /* Changed from right: 10px to left: 10px */
        bottom: 10px;
    }
}

/* AI Chat Widget Styles - Extensions */
#prompt-counter {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.chat-message.text-center {
    text-align: center;
}

.chat-message button {
    display: inline-block;
    transition: all 0.2s ease;
}

.chat-message button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ai-chat-header {
    position: relative;
}

.ai-chat-widget.limit-reached .ai-chat-input {
    opacity: 0.5;
    pointer-events: none;
}

.limit-notification {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
    padding: 10px 15px;
    margin: 10px 0;
    font-size: 0.9rem;
}

/* Guest prompt */
.assistant-message .guest-prompt {
    margin-top: 10px;
    padding: 8px;
    background-color: rgba(33, 37, 41, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
}

.assistant-message .guest-prompt a {
    font-weight: bold;
}

/* Favorite Button Styles */
.favorite-button-container {
    display: inline-block;
}

#favoriteBtn {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #dc3545;  /* Bootstrap's danger color */
    background-color: transparent;
    border: 1px solid #dc3545;
}

#favoriteBtn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

#favoriteBtn.favorited,
#favoriteBtn:active {
    background-color: #dc3545;
    color: white;
}

/* For the larger favorite button */
#favoriteBtnLarge {
    transition: all 0.2s ease;
}

/* Toast Notification Styles */
.toast {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 0.5rem;
}

.toast-header {
    background-color: rgba(248, 249, 250, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Favorites Page Styles */
.listing-thumbnail {
    height: 200px;
    object-fit: cover;
}

.remove-favorite-btn {
    transition: all 0.2s ease;
    opacity: 0.8;
}

.remove-favorite-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.favorite-item {
    transition: opacity 0.3s ease;
}

/* Heart animation for favoriting */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

.favorite-btn:active i {
    animation: heartBeat 1s;
}

/* Dropdown setup */
.dropdown-submenu {
  position: absolute;
  left: 100%;
  top: 0;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
}

.dropend {
  position: relative;
}

.dropend .dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid transparent;
  border-right: 0;
  border-bottom: 0.3em solid transparent;
  border-left: 0.3em solid;
}

.dropdown-submenu.show {
  display: block;
}

/* Optional: Add some hover effects for better UX */
.dropend:hover > .dropdown-toggle {
  background-color: #f8f9fa;
}

/* Add transition for smooth navbar hiding/showing */
.navbar {
  transition: transform 0.3s ease;
}

/* Class to hide navbar when scrolling down */
.navbar-hidden {
  transform: translateY(-100%);
}

/* Mobile session upload */
.photo-upload-options {
    margin-bottom: 20px;
}
.or-divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
}
.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: #dee2e6;
}
.or-divider::before {
    left: 0;
}
.or-divider::after {
    right: 0;
}
.or-divider span {
    display: inline-block;
    background-color: #fff;
    padding: 0 10px;
    position: relative;
    color: #6c757d;
}
#qrCodeContainer {
    background-color: #f8f9fa;
}

html {
  scroll-behavior: smooth;
}

/* AI Chat Disclaimer */
.ai-disclaimer {
    font-size: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    max-height: 60px;
    overflow-y: auto;
}