/* AI-Powered Search Result Page Styles */

/* Base Styles */
body {
    font-family: 'Rubik', sans-serif;
    background-color: #f8fafc;
}

.font-sans {
    font-family: 'Rubik', sans-serif !important;
}

/* Custom Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s ease forwards;
    opacity: 0;
}

.shimmer {
    animation: shimmer 2s infinite linear;
    background: var(--gv-search-shimmer-gradient);
    background-size: 1000px 100%;
}

/* Stagger delays for grid items */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

/* Filter Chips */
.filter-chip {
    transition: all 0.2s ease;
}

.filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.filter-chip button:hover {
    background-color: rgba(79, 70, 229, 0.1);
}

/* Advanced Filters Toggle */
#toggle-advanced {
    transition: all 0.3s ease;
}

#toggle-advanced:hover {
    color: var(--color-indigo-600);
}

/* Quick Filter Buttons */
.quick-filter-btn {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.quick-filter-btn:hover {
    border-color: rgba(79, 70, 229, 0.3);
}

/* Enhanced Filter Inputs */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: rgb(79 70 229);
    border-color: rgb(79 70 229);
}

/* Filter Section Spacing */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section label {
    transition: background-color 0.2s ease;
}

/* Save Search Button Enhancement */
#save-search-btn {
    position: relative;
    overflow: hidden;
}

#save-search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#save-search-btn:hover::before {
    left: 100%;
}

/* Collapsible WhatsApp CTA */
#whatsapp-cta {
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#cta-collapsed {
    transition: all 0.3s ease;
}

.cta-chevron {
    transition: transform 0.3s ease;
}

#cta-expanded {
    max-height: 80vh;
    overflow-y: auto;
}

/* Enhanced CTA animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.cta-slide-up {
    animation: slideUp 0.5s ease-out;
}

/* Custom Scrollbar for Filters */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Header Styles */
.sticky {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Mature, clean surfaces (override older glass-heavy look) */
.query-summary-bar,
.ai-insight-box,
.highlight-carousel,
.smart-filter-bar,
.ai-suggestions,
.cta-bar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Keep legacy class but make it cleaner */
.property-card-ai {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: none;
}

.property-card-ai:hover {
    transform: none;
    box-shadow: none;
}

/* View Toggle Styles */
#grid-view,
#list-view {
    transition: all 0.2s ease;
}

#grid-view:hover,
#list-view:hover {
    transform: scale(1.05);
}

/* List View Specific Styles */
#results-list .group {
    margin-bottom: 1rem;
}

#results-list .group:hover {
    transform: translateY(-2px);
}

/* AI Score Badge Enhancements */
.ai-score-badge {
    background: var(--gv-search-ai-score-gradient);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* AI Analysis Section */
.ai-analysis-card {
    background: var(--gv-search-ai-analysis-gradient);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

/* Property Feature Cards */
.property-feature-card {
    transition: all 0.3s ease;
}

.property-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Enhanced Agent Card */
.agent-info-card {
    background: var(--gv-search-agent-card-gradient);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

/* Rating Stars */
.rating-stars .lucide-star {
    fill: var(--gv-search-badge-star);
    color: var(--gv-search-badge-star);
}

/* Tag Styles */
.property-tag {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Enhanced Button Styles */
.btn-primary-enhanced {
    background: var(--gv-search-btn-primary-gradient);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

.btn-primary-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-secondary-enhanced {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
}

.btn-secondary-enhanced:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* Drawer Animation Logic */
.drawer-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-open {
    max-height: 2000px;
    /* Set high enough for max content */
    opacity: 1;
}

/* Enhanced AI Button Styling */
.ai-toggle-btn {
    transition: all 0.3s ease;
}

.ai-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Drawer Arrow Animation */
.drawer-arrow {
    transition: transform 0.3s ease;
}

.drawer-arrow.open {
    transform: rotate(180deg);
}

/* Enhanced Drawer Styling */
.ai-drawer {
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.95), rgba(248, 250, 252, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

/* Pros/Cons Sections */
.pros-cons-grid {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* Investment Signal Badges */
.investment-signal {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Custom small progress bar */
.meter {
    height: 6px;
    background: var(--gv-search-meter-bg);
    border-radius: 3px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 3px;
}

/* Feature Grid Enhancements */
.feature-grid-item {
    transition: all 0.2s ease;
}

.feature-grid-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Query Summary Bar */
.query-summary-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideDownFadeIn 0.6s ease-out;
}

@keyframes slideDownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Insight Box */
.ai-insight-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight Carousel */
.highlight-carousel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Smart Filter Bar */
.smart-filter-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Property Cards */
.property-card-ai {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
    animation: fadeInScale 0.6s ease-out forwards;
    opacity: 0;
    transform: scale(0.95);
}

.property-card-ai:nth-child(1) {
    animation-delay: 0.8s;
}

.property-card-ai:nth-child(2) {
    animation-delay: 0.9s;
}

.property-card-ai:nth-child(3) {
    animation-delay: 1.0s;
}

.property-card-ai:nth-child(4) {
    animation-delay: 1.1s;
}

.property-card-ai:nth-child(5) {
    animation-delay: 1.2s;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* AI Suggestions */
.ai-suggestions {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.8s ease-out 1.4s both;
}

/* CTA Bar */
.cta-bar {
    background: var(--gv-search-cta-bar-gradient);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUpFadeIn 0.8s ease-out 1.6s both;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Animation for AI Insight */
.typing-indicator {
    display: inline-block;
    width: 3px;
    height: 24px;
    background: var(--gv-search-typing-gradient);
    animation: blink 1.2s infinite;
    margin-left: 4px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Pulsing AI Badge */
.ai-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

/* Hover Effects */
.property-card-ai:hover {
    transform: none;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-results-bg {
        background-attachment: scroll;
    }

    .query-summary-bar,
    .ai-insight-box,
    .highlight-carousel,
    .smart-filter-bar,
    .ai-suggestions,
    .cta-bar {
        margin: 1rem;
        border-radius: 16px;
    }
}

/* Loading States */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Filter Animations */
.filter-select:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Button Hover Effects */
.apply-filters-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.clear-filters-btn:hover {
    color: #dc2626;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* AI Suggestion Hover Effects */
.ai-suggestion-btn:hover {
    transform: translateY(-2px);
}

/* Featured Card Animations */
.featured-card {
    transition: all 0.3s ease;
}

.featured-card:hover {
    transform: none;
    box-shadow: none;
}

/* Carousel Controls */
.carousel-controls button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Image Loading States */
.property-image {
    transition: opacity 0.3s ease;
}

.property-image.loaded {
    opacity: 1;
}

.property-image:not(.loaded) {
    opacity: 0.5;
}

/* Property Card Internal Animations */
.property-title {
    transition: color 0.3s ease;
}

.property-price {
    transition: transform 0.3s ease;
}

.property-card-ai:hover .property-price {
    transform: scale(1.05);
}

/* Status Badge Animations */
.status-badge,
.featured-badge {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* CTA Form Animations */
.cta-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.cta-submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Responsive List View */
@media (max-width: 1024px) {
    #results-list .flex {
        flex-direction: column;
    }

    #results-list .w-80 {
        width: 100%;
        height: 200px;
    }

    .property-feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    #results-list .p-6 {
        padding: 1rem;
    }

    .property-feature-grid {
        grid-template-columns: 1fr;
    }

    .agent-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Mobile drawer adjustments */
    .drawer-open {
        max-height: 3000px;
        /* Allow more space on mobile for mega drawer */
    }

    .ai-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .pros-cons-grid .grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .property-grid {
        grid-template-columns: 1fr;
    }

    .ai-suggestion-grid {
        grid-template-columns: 1fr;
    }

    .featured-properties {
        grid-template-columns: 1fr;
    }

    .cta-form {
        flex-direction: column;
        width: 100%;
    }

    .cta-input {
        max-width: none;
        width: 100%;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .search-results-bg::before {
        display: none;
    }

    .query-summary-bar,
    .ai-insight-box,
    .highlight-carousel,
    .smart-filter-bar,
    .property-card-ai,
    .ai-suggestions,
    .cta-bar {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.98);
        border: 2px solid #000;
    }
}

/* Print Styles */
@media print {
    .search-results-bg {
        background: white !important;
    }

    .search-results-bg::before {
        display: none;
    }

    .query-summary-bar,
    .ai-insight-box,
    .highlight-carousel,
    .smart-filter-bar,
    .property-card-ai,
    .ai-suggestions,
    .cta-bar {
        backdrop-filter: none;
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .cta-bar {
        display: none;
    }
}