/* Filters Styles */

.autocomplete-section {
    padding: 8px 0;
}

.autocomplete-section:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

.autocomplete-section-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.autocomplete-section-title i {
    color: #F44336;
}

.autocomplete-recipient-group {
    margin-bottom: 4px;
}

.autocomplete-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f5f5f5;
}

.autocomplete-recipient {
    font-weight: 500;
    background: #fafafa;
}

.autocomplete-recipient.match {
    background: #fff3cd;
}

.autocomplete-recipient:hover {
    background: #f0f0f0;
}

.autocomplete-recipient.match:hover {
    background: #ffe69c;
}

.autocomplete-presents-list {
    background: #f9f9f9;
    border-left: 3px solid #F44336;
    margin-left: 16px;
}

.autocomplete-present {
    padding-left: 32px;
    font-size: 13px;
}

.autocomplete-present.match {
    background: #fff3cd;
}

.autocomplete-present:hover {
    background: #ffe69c;
}

.autocomplete-more-presents {
    padding: 6px 16px 6px 48px;
    font-size: 11px;
    color: #999;
    font-style: italic;
}

.autocomplete-item i {
    color: #F44336;
    font-size: 16px;
    min-width: 20px;
}

.autocomplete-item-content {
    flex: 1;
    min-width: 0;
}

.autocomplete-item-title {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.autocomplete-more {
    padding: 8px 16px;
    font-size: 12px;
    color: #666;
    text-align: center;
    font-style: italic;
}

.autocomplete-empty {
    padding: 32px 16px;
    text-align: center;
    color: #999;
}

.autocomplete-empty i {
    font-size: 32px;
    color: #ddd;
    margin-bottom: 12px;
}

.autocomplete-empty p {
    margin: 0;
    font-size: 14px;
}

/* Search highlight effects */
.search-highlight {
    animation: highlightPulse 1s ease;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.3) !important;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(244, 67, 54, 0.3);
    }
}

.highlight-flash {
    animation: flashHighlight 2s ease;
}

@keyframes flashHighlight {
    0%, 100% {
        background: transparent;
    }
    10%, 30%, 50% {
        background: rgba(255, 235, 59, 0.3);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-autocomplete-dropdown {
        max-height: 300px;
        border-radius: 8px;
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        min-width: unset;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }

    .autocomplete-section-title {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Scrollbar styling */
.search-autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.search-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.search-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}


/* Enhanced Search Input Styling */
.search-container {
    min-width: 300px;
    max-width: 400px;
    width: 100%;
}

.search-input-wrapper {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
    border-color: #F44336;
}

.search-icon-wrapper {
    background: white !important;
    border: none !important;
    padding-left: 14px;
    padding-right: 10px;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon {
    color: #F44336 !important;
    font-size: 16px;
    opacity: 0.8;
    flex-shrink: 0;
}

.search-input {
    border: none !important;
    padding-left: 8px !important;
    padding-right: 12px;
    font-size: 14px;
    background: transparent;
    flex: 1;
    min-width: 0;
}

.search-input:focus {
    box-shadow: none !important;
    outline: none !important;
}

.search-input-wrapper:focus-within .search-icon {
    opacity: 1;
    color: #F44336 !important;
}

.search-input::placeholder {
    color: #999;
    font-size: 13px;
}

/* Mobile responsive search */
@media (max-width: 768px) {
    .search-container {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        margin-top: 12px;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .search-icon {
        font-size: 14px;
    }
    
    .search-input {
        font-size: 13px;
    }
    
    .search-input::placeholder {
        font-size: 12px;
    }
}

/* Tablet and desktop */
@media (min-width: 769px) {
    .search-container {
        flex-shrink: 0;
    }
}


/* Filter Button */
.filter-toggle-btn {
    min-width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    background: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-toggle-btn:hover {
    background: #f8f9fa;
    border-color: #F44336;
    color: #F44336;
}

.filter-toggle-btn.active {
    background: #F44336;
    border-color: #F44336;
    color: white;
}

/* Filter Panel */
.filter-panel {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 16px 20px;
}

.filter-panel-content {
    max-width: 100%;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin: 0;
    white-space: nowrap;
}

.filter-select {
    min-width: 200px;
    font-size: 14px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
}

.filter-select:focus {
    border-color: #F44336;
    box-shadow: 0 0 0 0.2rem rgba(244, 67, 54, 0.25);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.filter-option:hover {
    background: #f8f9fa;
    border-color: #F44336;
    color: #F44336;
}

.filter-option.active {
    background: #F44336;
    border-color: #F44336;
    color: white;
}

.filter-option i {
    font-size: 12px;
}

/* Desktop - keep everything in one line */
@media (min-width: 769px) {
    .filter-panel-content > div {
        flex-wrap: nowrap;
    }
}

/* Mobile responsive filters */
@media (max-width: 768px) {
    .filter-panel {
        padding: 12px 16px;
    }
    
    .filter-panel-content > div {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .filter-select {
        width: 100%;
        min-width: 100%;
    }
    
    .filter-options {
        gap: 6px;
        justify-content: flex-start;
        width: 100%;
    }
    
    .filter-option {
        padding: 6px 12px;
        font-size: 12px;
        flex: 0 0 auto;
    }
    
    .filter-option i {
        font-size: 11px;
    }
    
    .filter-label {
        font-size: 12px;
    }
}


/* Collapse space when presents are hidden */
.present-item {
    transition: all 0.3s ease;
}

.present-item[style*="display: none"] {
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
}

/* Smooth transitions for recipient cards */
.recipient-item {
    transition: all 0.3s ease;
}

/* Filtered-out recipient cards must actually leave the layout so the
   remaining cards flow up. High specificity + !important beats both the
   `.recipient-item { display: block !important }` rule below and the
   page's own padding/margin !important rules. */
.recipients-page .recipient-item[style*="display: none"],
.recipient-item[style*="display: none"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* Ensure present containers collapse properly */
.presents-preview,
.presents-list,
.presents-list-container {
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Remove fixed heights and let content determine size */
.presents-preview,
.presents-list,
.presents-list-container {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

/* Ensure parent containers also collapse */
.recipient-card,
.recipient-item .col-lg-6,
.recipient-item .presents-preview {
    height: auto !important;
    min-height: 0 !important;
}


/* Force containers to shrink when children are hidden */
.recipient-item {
    display: block !important;
    overflow: visible !important;
}

.recipient-item > .row {
    display: flex !important;
    flex-wrap: wrap !important;
}

/* Make sure hidden presents don't take up space - CRITICAL */
.recipients-page .present-item[style*="display: none"],
.present-item[style*="display: none"] {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* Ensure smooth height transitions for visible presents */
.recipients-page .present-item:not([style*="display: none"]),
.present-item:not([style*="display: none"]) {
    display: block !important;
    animation: fadeIn 0.3s ease;
    height: auto !important;
    margin-bottom: 8px !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Force presents container to collapse */
.recipients-page .presents-preview,
.recipients-page .presents-list,
.recipients-page .presents-list-container,
.presents-preview,
.presents-list,
.presents-list-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    height: auto !important;
    min-height: 0 !important;
}


/* Reserve button hover - make icon white */
.btn-outline-warning:hover i,
.btn-outline-warning:hover .fas,
.btn-outline-warning:hover .far {
    color: white !important;
}

/* Also for the reserve button specifically */
button[onclick*="reservePresent"]:hover i,
button[onclick*="reservePresent"]:hover .fas,
button[onclick*="reservePresent"]:hover .far {
    color: white !important;
}

/* Ensure all button icons change to white on hover */
.btn-outline-warning:hover,
.btn-outline-warning:hover * {
    color: white !important;
}


/* Call to action section - Red background with 70% transparency */
.aws-action-section {
    background: rgba(244, 67, 54, 0.7) !important;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(244, 67, 54, 0.3);
}

/* Ensure action cards stand out against red background */
.aws-action-section .aws-action-card {
    background: rgba(255, 255, 255, 0.95) !important;
}

.aws-action-section .aws-action-card:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}
