/* #list-view-toggle-btn positioning is in layout.css */
/* Appearance for #list-view-toggle-btn */
#list-view-toggle-btn {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #4a4a4a;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    /* Ensure above map elements */
}

#list-view-toggle-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    color: var(--primary-color, #0078A8);
}

#list-view-toggle-btn i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#list-view-toggle-btn.active {
    color: #fff;
    background-color: var(--primary-color, #0078A8);
    border-color: var(--primary-color, #0078A8);
}

#list-view-toggle-btn.active i {
    transform: rotate(180deg);
}

#list-view-toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* Sidebar Appearance */
#list-view-sidebar {
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
}

#list-view-sidebar.open {
    transform: translateX(0);
}

/* Header & Controls */
#list-view-header {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    z-index: 5;
    gap: 12px;
}

#list-view-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#list-view-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.02em;
}

#list-view-header #list-view-count {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.list-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.view-toggle-group {
    display: flex;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn.active {
    background: #fff;
    color: var(--primary-color, #0078A8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sort-control-group {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #777;
    font-size: 14px;
}

.sort-select {
    border: none;
    background: #f5f5f5;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    outline: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sort-select:hover {
    background: #eee;
}

.sort-select:focus {
    background: #eee;
    box-shadow: 0 0 0 2px rgba(0, 120, 168, 0.2);
}

.sort-direction-btn {
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sort-direction-btn:hover {
    background: #eee;
    color: var(--primary-color, #0078A8);
}

.sort-direction-btn:active {
    transform: scale(0.95);
}

.sort-direction-btn i {
    transition: transform 0.2s ease;
}

/* List Content */
#list-view-content {
    flex-grow: 1;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background-color: #fafafa;
}

#list-view-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-view-item {
    display: flex;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    outline: none;
    position: relative;
    align-items: flex-start;
    /* Align top for better handling of varying heights */
}

.list-view-item:hover {
    background-color: #fcfcfc;
}

.list-view-item.active {
    background-color: #f0f9ff;
    border-left: 3px solid var(--primary-color, #0078A8);
    padding-left: 17px;
}

.list-view-item:last-child {
    border-bottom: none;
}

/* Passed Event Style */
.list-view-item.passed-event-item {
    background-color: #fcfcfc;
    color: #999;
    opacity: 0.85;
}

.list-view-item.passed-event-item .list-view-item-name {
    color: #888;
    text-decoration: line-through;
    /* Additional visual cue? Maybe too strong. Let's stick to simple greying out. */
    text-decoration: none;
}

.list-view-item.passed-event-item:hover {
    background-color: #f5f5f5;
    opacity: 1;
}

.list-view-item.passed-event-item .list-view-item-date {
    color: #bbb;
}

.list-view-item.passed-event-item .list-view-item-img-container {
    filter: grayscale(100%);
    opacity: 0.7;
}


/* Soon Event Style (within 1 month) */
.list-view-item.soon-event-item {
    background-color: #fffaf0;
    /* Light orange/cream */
    border-left: 3px solid #e67e22;
    /* Carrot Orange */
    padding-left: 17px;
    /* Compensate for border same as active */
}

.list-view-item.soon-event-item:hover {
    background-color: #fef5e6;
}

.list-view-item.soon-event-item .list-view-item-name {
    color: #d35400;
    /* Darker Orange */
}

.list-view-item.soon-event-item .list-view-item-date {
    color: #e67e22;
    font-weight: 600;
}

/* Ongoing Event Style (active now) */
.list-view-item.ongoing-event-item {
    background-color: #f0fff4;
    /* Light green */
    border-left: 3px solid #2ecc71;
    /* Emerald Green */
    padding-left: 17px;
}

.list-view-item.ongoing-event-item:hover {
    background-color: #e6fffa;
}

.list-view-item.ongoing-event-item .list-view-item-name {
    color: #27ae60;
}

.list-view-item.ongoing-event-item .list-view-item-date {
    color: #27ae60;
    font-weight: 700;
}

.list-view-item.ongoing-event-item .list-view-item-date::before {
    content: '● ';
    color: #2ecc71;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

/* Active & Soon Conflict - Active takes precedence for background usually, but let's mix */
.list-view-item.soon-event-item.active {
    background-color: #fff3e0;
    border-left-color: #d35400;
}

/* Image Container */
.list-view-item-img-container {
    width: 90px;
    height: 70px;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Locked / Unauthorized State */
.list-view-item-img-container.locked {
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.locked-placeholder {
    color: #adb5bd;
    font-size: 20px;
}

/* Spinner and fallbacks - existing styles refined */
.list-view-item-img-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #777;
    border-radius: 50%;
    animation: spin-small 1s linear infinite;
    z-index: 1;
    transition: opacity 0.3s;
}

.list-view-item-img-container.loaded::before {
    opacity: 0;
}

.list-view-item-img-container.no-image::before {
    display: none;
}

.list-view-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: scale(1.1);
}

.list-view-item-img.loaded {
    opacity: 1;
    transform: scale(1);
}

.list-view-item-details {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2px;
}

.list-view-item-name {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.list-view-item-date {
    font-size: 12px;
    font-weight: 500;
    color: #95a5a6;
    /* Neutral grey */
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-view-item-date i {
    font-size: 11px;
}

.list-view-item-offers {
    display: flex;
    gap: 10px;
    font-size: 14px;
    color: #95a5a6;
}

/* Sort-specific metadata */
.list-view-item-meta {
    font-size: 11px;
    font-weight: 500;
    color: #7f8c8d;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    width: fit-content;
}

.list-view-item-meta i {
    font-size: 10px;
}

.list-view-item-meta.validated {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.list-view-item-meta.validated i {
    color: #27ae60;
}

.list-view-item-meta.not-validated {
    color: #95a5a6;
    background: #f8f8f8;
}

.list-view-item-meta.not-validated i {
    color: #bdc3c7;
}

/* No Results */
#list-view-no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: #7f8c8d;
    padding: 40px 20px;
}

#list-view-no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ecf0f1;
}

#list-view-no-results p {
    font-size: 15px;
    color: #7f8c8d;
    max-width: 240px;
}

/* Admin Actions */
.list-view-item-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #f0f0f0;
}

.list-view-action-btn {
    font-size: 14px;
    color: #bdc3c7;
    transition: color 0.2s;
    padding: 4px;
}

.list-view-action-btn:hover {
    color: var(--primary-color, #0078A8);
}

.list-view-action-btn[data-action="admin-delete-place"]:hover {
    color: #e74c3c;
}

/* Animations */
@keyframes spin-small {
    to {
        transform: rotate(360deg);
    }
}