/**
 * Public List CSS
 * Uses theme variables for dark/light mode compatibility
 * Responsive design: Desktop (4 cols), Tablet (3 cols), Mobile (2 cols)
 */

/* ==================== CONTAINER ==================== */
.public-list-container {
    padding: 2rem 0;
    min-height: 100vh;
}

/* ==================== LIST HEADER ==================== */
.public-list-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Gradient overlay using module colors */
.public-list-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--module-primary), var(--module-secondary));
}

.list-header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.list-icon-wrapper {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--module-primary), var(--module-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.list-module-icon {
    font-size: 2.5rem;
    color: #ffffff;
}

.list-info {
    flex: 1;
}

.list-title {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.list-owner {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.list-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Share Button */
.list-share-btn-wrapper {
    flex-shrink: 0;
    margin-left: auto;
}

.btn-share-list {
    background: var(--module-primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-share-list:hover {
    background: var(--module-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-share-list:active {
    transform: translateY(0);
}

.btn-share-list i {
    font-size: 1.1rem;
}

.list-badge {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==================== ITEMS GRID ==================== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* ==================== ITEM CARD ==================== */
.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Image Wrapper */
.item-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--bg-hover);
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.item-card:hover .item-image {
    transform: scale(1.05);
}

.item-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

/* Favorite Badge */
.favorite-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    animation: heartbeat 1.5s ease-in-out infinite;
}

.favorite-badge i {
    color: #ffffff;
    font-size: 1.2rem;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Content */
.item-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Situation Badge - moved to top after title */
.item-situation {
    margin-bottom: 0.75rem;
}

/* Score */
.item-score {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.item-score i {
    color: #fbbf24;
    font-size: 0.9rem;
}

.score-value {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

/* Progress */
.item-progress {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* Achievements */
.item-achievements {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.achievement-percentage {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.situation-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    color: var(--text-muted);
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.empty-state-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

/* ==================== RESPONSIVE - TABLET ==================== */
@media (min-width: 768px) and (max-width: 991px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .list-title {
        font-size: 1.75rem;
    }

    .list-icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .list-module-icon {
        font-size: 2rem;
    }
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 767px) {
    .public-list-container {
        padding: 1rem 0;
    }

    /* Header - Vertical Layout */
    .list-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .public-list-header {
        padding: 1.5rem;
    }

    .list-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .list-module-icon {
        font-size: 1.75rem;
    }

    .list-title {
        font-size: 1.5rem;
    }

    .list-owner {
        font-size: 1rem;
    }

    .list-meta {
        justify-content: center;
    }

    /* Grid - 2 columns on mobile */
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Cards - Smaller padding */
    .item-content {
        padding: 0.75rem;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .item-score i, .item-progress, .item-achievements {
        font-size: 0.8rem;
    }

    /* Empty State */
    .empty-state {
        padding: 3rem 1rem;
    }

    .empty-state-icon {
        font-size: 3rem;
    }

    .empty-state-title {
        font-size: 1.25rem;
    }

    .empty-state-text {
        font-size: 0.9rem;
    }

    /* Touch targets - minimum 44x44px */
    .item-card {
        min-height: 44px;
    }
}

/* ==================== THEME SPECIFIC ADJUSTMENTS ==================== */

/* Dark Theme */
.theme-indigo-dark .public-list-header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
}

.theme-indigo-dark .item-card {
    background: rgba(30, 41, 59, 0.6);
}

.theme-indigo-dark .item-card:hover {
    background: rgba(30, 41, 59, 0.9);
}

.theme-indigo-dark .item-footer {
    background: rgba(99, 102, 241, 0.05);
    border-top-color: rgba(99, 102, 241, 0.2);
}

/* Light Theme */
.theme-indigo-light .public-list-header {
    background: rgba(255, 255, 255, 0.95);
}

.theme-indigo-light .item-card {
    background: rgba(255, 255, 255, 0.9);
}

.theme-indigo-light .item-card:hover {
    background: rgba(255, 255, 255, 1);
}

.theme-indigo-light .item-footer {
    background: rgba(99, 102, 241, 0.03);
    border-top-color: rgba(99, 102, 241, 0.15);
}
/* ==================== FILTERS CONTAINER ==================== */
.filters-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filters-container .form-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.filters-container .form-select,
.filters-container .form-control {
    border-radius: 8px;
    transition: all 0.3s ease;
}

.filters-container .form-select:focus,
.filters-container .form-control:focus {
    border-color: var(--module-primary, #667eea);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.filters-container .form-control::placeholder {
    color: var(--text-muted);
}

/* ==================== ADD BUTTON STYLES ==================== */
/* Item Footer - separated section at bottom of card */
.item-footer {
    border-top: 1px solid var(--border-color);
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.02);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    flex-shrink: 0;
}

.add-button-wrapper {
    position: relative;
    width: 100%;
}

.btn-add-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.btn-add-toggle:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.btn-add-toggle:active {
    transform: translateY(0);
}

.badge-in-library {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    font-size: 0.875rem;
    font-weight: 600;
    width: 100%;
    justify-content: center;
}

.add-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.3);
    display: none;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
    padding: 0.5rem 0;
}

.add-dropdown-menu.show {
    display: block;
    animation: slideUpFade 0.3s ease;
}

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

.dropdown-item {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-align: left;
}

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

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    color: var(--primary-light);
}

.dropdown-item:active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
}
