/* === Results Screen Redesign === */

/* Cards View Container - Increased Top Padding to avoid X overlap */
.results-cards-view {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 60px 16px 30px;
    /* Top 60px for close btn */
    box-sizing: border-box;
}

/* Compact Action Buttons Grid - Smaller */
.results-compact-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 auto 25px;
    max-width: 400px;
    /* Constrain width */
}

/* Reduced Button Size */
.compact-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    /* Very subtle glass */
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 55px;
    /* Reduced from 70px */
    color: var(--text-light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.compact-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.compact-btn:active {
    transform: translateY(0);
}

/* Icon size refinement */
.compact-btn span:first-child {
    font-size: 1.2rem;
    /* Reduced from 1.5rem */
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Text refinement */
.compact-btn span:last-child {
    font-size: 0.65rem;
    /* Reduced from 0.7rem */
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    opacity: 0.9;
}

/* Specific button tints (subtle borders/glows) */
.compact-btn-pdf {
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
}

.compact-btn-save {
    border-bottom: 2px solid rgba(155, 89, 182, 0.3);
}

.compact-btn-budget {
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
}

.compact-btn-map {
    border-bottom: 2px solid rgba(46, 204, 113, 0.3);
}


/* Refinement Chat at Bottom - Centering Fix & Size Increase */
/* Refinement Chat at Bottom - Centering Fix & Size Increase */
.refinement-chat-bottom {
    margin: 30px auto 0;
    padding: 25px 20px;
    background: rgba(20, 25, 45, 0.6);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.refinement-chat-bottom h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--primary-accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
    width: 100%;
}

.refinement-chat-bottom .refinement-input-group {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Override input size for this view - Full Width */
.refinement-chat-bottom .refinement-textarea {
    flex: 1;
    /* Takes available space */
    height: 60px !important;
    font-size: 1rem !important;
    padding: 15px 20px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    width: 100%;
    /* Ensure width */
}

/* Smaller Arrow Button */
.refinement-chat-bottom .btn-refine {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0;
    font-size: 1.1rem !important;
    border-radius: 50%;
}

/* Warning Text Below */
.refinement-warning-below {
    margin-top: 12px;
    font-size: 0.85rem;
    color: rgba(255, 170, 0, 0.9);
    text-align: center;
}



/* === Map View Styles === */
.results-map-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #000;
}

.results-map-view .results-map {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.results-map-view #map {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
}

/* 
   FIX 1: Top-Left Map Filter
   Professional dropdown with numbers only behavior
*/
.results-map-view .map-filter-container {
    position: absolute;
    top: 20px;
    left: 20px;
    /* Moved to extreme left */
    transform: none;
    /* Removed centering */
    z-index: 100;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 100px;
    /* Smaller min-width */
    transition: all 0.3s ease;
}

/* When active, expand nicely */
.results-map-view .map-filter-container.active {
    border-radius: 24px;
    background: rgba(10, 14, 39, 0.95);
}

.map-filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Numbers only grid for dropdown */
/* Vertical Scrollable List */
.map-day-dropdown {
    display: none;
    flex-direction: column;
    align-items: center;
    /* Center bubbles */
    gap: 10px;
    padding: 15px 0;
    margin-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 50vh;
    /* Scrollable on mobile */
    overflow-y: auto;

    /* Hide scrollbar for cleaner look */
    scrollbar-width: none;
}

.map-day-dropdown::-webkit-scrollbar {
    display: none;
}

.map-filter-container.active .map-day-dropdown {
    display: flex;
}

/* Day Option Capsules (Just Numbers) */
.map-day-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.map-day-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.map-day-option.selected {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

/* "All" option - maybe an infinity symbol or "All"? */
.map-day-option[data-day="0"] {
    width: auto;
    padding: 0 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
}


/* 
   FIX 2: Map Bottom Buttons - OUTSIDE Map
*/
.map-actions-bottom {
    /* Static positioning in flex layout */
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    /* Flex item properties */
    flex: 0 0 auto;
    /* Fixed height, dont shrink */
    z-index: 10;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    /* More padding */
    width: 100%;

    /* Solid background to separate from map */
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Keep button styling same as user liked */
.map-actions-bottom .btn {
    pointer-events: auto;
    flex: 0 0 auto;
    width: 55px !important;
    /* Slightly larger */
    height: 55px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    font-size: 1.3rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.map-actions-bottom .btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.map-actions-bottom .btn span:last-child {
    display: none;
    /* Hide text, icon only for pro look */
}

/* Tooltip for icon-only buttons */
.map-actions-bottom .btn::after {
    content: attr(title);
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.map-actions-bottom .btn:hover::after {
    opacity: 1;
}

/* Primary Action Highlight (Save) */
.map-actions-bottom .btn[onclick="downloadItinerary()"] {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    transform: scale(1.1);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .results-compact-buttons {
        gap: 8px;
    }

    .compact-btn {
        padding: 10px 4px;
        min-height: 65px;
    }

    .map-filter-container {
        top: 15px;
        width: auto;
        min-width: 80px;
    }

    .map-actions-bottom {
        padding: 15px;
    }
}

/* FIX: Back Button Arrow Visibility */
.map-actions-bottom .btn[onclick="closeMapFullscreen()"] span:first-child {
    color: #ff4757;
    /* Bright Red/Pink for high visibility */
    font-weight: 900;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.map-actions-bottom .btn[onclick="closeMapFullscreen()"] {
    border-color: rgba(255, 71, 87, 0.3);
}