/**
 * Your LifeLists Modal
 * Full-screen modal displaying user's lifelists in 2-column grid
 */

/* Modal Overlay */
#yourLifeListsModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Mobile Full Screen */
@media (max-width: 768px) {
    #yourLifeListsModal {
        padding: 0;
    }
    .lifelists-modal-inner {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        overflow-y: auto;
    }
}

#yourLifeListsModal.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header */
.lifelists-modal-header {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #DDDDDD;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lifelists-modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #222222;
    line-height: 1.625rem;
    letter-spacing: -0.0275rem;
    margin: 0;
}

.lifelists-modal-close {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #F7F7F7;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lifelists-modal-close:hover {
    background: #EBEBEB;
}

.lifelists-modal-close i {
    font-size: 16px;
    color: #222222;
}

/* Tabs Container - Material Design */
.lifelists-modal-tabs {
    border-bottom: 2px solid #e0e0e0;
    background: white;
    display: flex;
    max-width: 600px;
    margin: 0;
    padding: 0 20px;
}

.lifelists-tab {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: none;
    color: #666;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.lifelists-tab.active {
    color: #8b5cf6;
    border-bottom: 3px solid #8b5cf6;
    background: none;
}

.lifelists-tab:hover {
    color: #8b5cf6;
}

.lifelists-modal-search-bar {
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.lifelists-search-wrapper {
    flex: 1;
    position: relative;
}

.lifelists-search-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

.lifelists-search-input:focus {
    border-color: #8b5cf6;
}

.lifelists-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.lifelists-filter-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.lifelists-filter-btn:hover {
    border-color: #8b5cf6;
    background: #f8f9fa;
}

.lifelists-filter-btn i {
    font-size: 16px;
    color: #333;
}

.lifelists-filter-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    background: #8b5cf6;
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
}

/* Inner Container for Desktop Centering */
.lifelists-modal-inner {
    background: #fff;
    max-width: 1200px;
    max-height: 90vh;
    margin: 20px auto;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Content Container */
.lifelists-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Grid Layout */
.lifelists-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Lifelist Card */
.lifelist-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
}

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

/* Card Image Container */
.lifelist-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
}

.lifelist-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gradient Fallback (when no featured image) */
.lifelist-card-image.gradient-bg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lifelist-card-image.gradient-bg i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
}

/* Gradient Colors from palette */
.gradient-rausch {
    background: linear-gradient(to right, #E61E4D 0%, #E31C5F 50%, #D70466 100%);
}

.gradient-plus {
    background: linear-gradient(to right, #BD1E59 0%, #92174D 50%, #861453 100%);
}

.gradient-luxe {
    background: linear-gradient(to right, #59086E 0%, #460479 50%, #440589 100%);
}

.gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.gradient-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Card Content */
.lifelist-card-content {
    padding: 12px;
}

.lifelist-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
    line-height: 1.25rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Loading State */
.lifelists-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6A6A6A;
}

.lifelists-loading i {
    font-size: 32px;
    color: #8b5cf6;
    animation: spin 1s linear infinite;
}

/* Skeleton Loading */
.lifelists-skeleton {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0;
}

.lifelists-skeleton-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

.lifelists-skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(
        90deg,
        #e5e7eb 0%,
        #f3f4f6 50%,
        #e5e7eb 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.lifelists-skeleton-content {
    padding: 12px;
}

.lifelists-skeleton-title {
    height: 18px;
    width: 85%;
    background: linear-gradient(
        90deg,
        #e5e7eb 0%,
        #f3f4f6 50%,
        #e5e7eb 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 6px;
}

.lifelists-skeleton-subtitle {
    height: 14px;
    width: 55%;
    background: linear-gradient(
        90deg,
        #e5e7eb 0%,
        #f3f4f6 50%,
        #e5e7eb 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

/* Empty State */
.lifelists-empty {
    text-align: center;
    padding: 80px 20px;
}

.lifelists-empty i {
    font-size: 64px;
    color: #DDDDDD;
    margin-bottom: 20px;
}

.lifelists-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: #222222;
    margin: 0 0 8px 0;
}

.lifelists-empty p {
    font-size: 14px;
    color: #6A6A6A;
    margin: 0 0 20px 0;
}

.lifelists-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--palette-rausch-gradient, #FF385C) 0%, var(--palette-plus-gradient, #E61E4D) 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 56, 92, 0.2);
}

.lifelists-empty-cta i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.lifelists-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 56, 92, 0.4);
    color: #fff !important;
}

.lifelists-empty-cta:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* Responsive - Single Column on Small Screens */
@media (max-width: 480px) {
    .lifelists-grid {
        grid-template-columns: 1fr;
    }
    
    .lifelists-modal-tabs,
    .lifelists-modal-search-bar {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .lifelists-modal-content {
        padding: 16px;
    }
}

/* Filter Modal */
.lifelists-filter-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 100000;
}

.lifelists-filter-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
}

.lifelists-filter-modal-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
    padding: 18px 20px 16px 20px;
}

.lifelists-filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.lifelists-filter-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.lifelists-filter-close {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: none;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lifelists-filter-close i {
    font-size: 14px;
    color: #4B5563;
}

.lifelists-filter-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.lifelists-filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4B5563;
    margin-bottom: 4px;
}

.lifelists-filter-group select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #D1D5DB;
    font-size: 14px;
}

/* Search-based filter inputs */
.lifelists-destination-search-wrapper,
.lifelists-passion-search-wrapper {
    position: relative;
}

.lifelists-filter-search-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border-radius: 10px;
    border: 1px solid #D1D5DB;
    font-size: 14px;
    transition: border-color 0.2s;
}

.lifelists-filter-search-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.lifelists-filter-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    font-size: 14px;
}

/* Dropdown options list */
.lifelists-filter-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.lifelists-filter-options li {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background 0.15s;
}

.lifelists-filter-options li:hover {
    background: #F3F4F6;
}

.lifelists-filter-options li.no-results {
    color: #9CA3AF;
    cursor: default;
    text-align: center;
}

.lifelists-filter-options li.no-results:hover {
    background: transparent;
}

/* Selected filter display */
.lifelists-selected-filter {
    margin-top: 8px;
    padding: 8px 12px;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lifelists-remove-destination,
.lifelists-remove-passion {
    background: none;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 14px;
    transition: color 0.15s;
}

.lifelists-remove-destination:hover,
.lifelists-remove-passion:hover {
    color: #EF4444;
}

.lifelists-filter-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.lifelists-filter-clear,
.lifelists-filter-apply {
    flex: 1;
    border-radius: 999px;
    padding: 9px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.lifelists-filter-clear {
    background: #F3F4F6;
    color: #374151;
}

.lifelists-filter-apply {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
}
