/* Dynamic Theme Cards - Compact Horizontal Design with macOS Dock Effect */
/*
   Scrolling should be handled by a wrapper (e.g. #theme-cards-scroll on dashboard)
   so the hover scale effect isn't clipped vertically.
*/
#theme-cards-container {
    display: inline-flex;
    gap: 10px;
    flex-wrap: nowrap;
    padding: 0;
    margin: 0;
}

.theme-card {
    align-content: center;
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 120px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease,
                background 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid #e5e7eb;
    /* Scale evenly up/down/left/right (avoid moving into the map above) */
    transform-origin: center center;
    will-change: transform;
}

/* Flat color variants */
.theme-card[data-color="blue"] {
    --card-color: #3b82f6;
}

.theme-card[data-color="green"] {
    --card-color: #10b981;
}

.theme-card[data-color="purple"] {
    --card-color: #8b5cf6;
}

.theme-card[data-color="orange"] {
    --card-color: #f59e0b;
}

.theme-card[data-color="red"] {
    --card-color: #ef4444;
}

.theme-card[data-color="pink"] {
    --card-color: #ec4899;
}

.theme-card:hover {
    /* Dock-like magnification without shifting upward */
    transform: scale(1.18) translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--card-color, #3b82f6);
    z-index: 100;
}

/* macOS Dock-like effect: scale adjacent cards slightly */
.theme-card:hover + .theme-card,
.theme-card:has(+ .theme-card:hover) {
    transform: scale(1.06) translateY(-4px);
    z-index: 9;
}

/* Scale cards 2 positions away even less */
.theme-card:hover + .theme-card + .theme-card,
.theme-card:has(+ .theme-card + .theme-card:hover) {
    transform: scale(1.03);
    z-index: 8;
}

/* Ensure hover cards can appear above neighboring sections */
#theme-cards-scroll {
    position: relative;
    z-index: 50;
}

.theme-card.active {
    background: var(--card-color, #3b82f6);
    border-color: var(--card-color, #3b82f6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-card.active h3,
.theme-card.active p {
    color: #ffffff;
}

.theme-card.active .theme-card-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* Icon - Compact */
.theme-card-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 6px;
    margin: 0 auto 6px;
    transition: all 0.2s ease;
}

.theme-card:hover .theme-card-icon {
    transform: scale(1.05);
}

/* Text */
.theme-card h3 {
    font-size: 12px;
    margin: 0 0 3px 0;
    color: #111827;
    font-weight: 600;
    text-align: center;
    transition: color 0.2s ease;
}

.theme-card p {
    font-size: 10px;
    margin: 0;
    color: #6b7280;
    line-height: 1.3;
    text-align: center;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badge for multi-level */
.theme-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.theme-card.active .theme-card-badge {
    background: rgba(255, 255, 255, 0.9);
    color: #059669;
}

/* Loading skeleton */
.theme-card.skeleton {
    pointer-events: none;
    background: #f3f4f6;
    animation: skeletonLoading 1.5s ease-in-out infinite;
}

@keyframes skeletonLoading {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.theme-card.skeleton .theme-card-icon,
.theme-card.skeleton h3,
.theme-card.skeleton p {
    background: #e5e7eb;
    color: transparent;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .theme-card {
        min-width: 120px;
        padding: 10px 12px;
    }
    
    .theme-card-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .theme-card h3 {
        font-size: 12px;
    }
    
    .theme-card p {
        font-size: 10px;
    }
}
