/* ================================================
   Pinterest-Style Grid für lillipix Bibliothek
   ================================================ */

/* Section Styling */
.pinterest-library {
    padding: 4rem 0;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}

/* Filter-Leiste */
.pinterest-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
    align-items: center;
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: #f8f5ff;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.filter-search:focus-within {
    border-color: #8B5CF6;
    background: white;
}

.filter-search svg {
    color: #8B5CF6;
    flex-shrink: 0;
}

.filter-input {
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #1f2937;
    width: 100%;
    outline: none;
}

.filter-input::placeholder {
    color: #9ca3af;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.filter-tag.active {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border-color: #8B5CF6;
    color: white;
}

.age-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    min-width: 160px;
    outline: none;
    transition: all 0.3s ease;
}

.age-select:hover,
.age-select:focus {
    border-color: #8B5CF6;
}

/* Pinterest Masonry Grid */
.pinterest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    grid-auto-rows: 10px;
}

/* Pin Card */
.pin-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.pin-card.short {
    grid-row: span 28;
}

.pin-card.medium {
    grid-row: span 34;
}

.pin-card.tall {
    grid-row: span 40;
}

.pin-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
}

.pin-card.featured {
    border: 3px solid #8B5CF6;
}

.pin-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.pin-link.locked {
    position: relative;
}

/* Pin Image / Icon Area */
.pin-image {
    position: relative;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    flex: 1;
}

.pin-icon-wrapper {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.pin-icon-wrapper svg {
    transition: all 0.3s ease;
}

.pin-card:hover .pin-icon-wrapper svg {
    transform: scale(1.1);
}

/* Category Colors */
.pin-icon-wrapper.mathe {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}
.pin-icon-wrapper.mathe svg {
    stroke: #d97706;
}

.pin-icon-wrapper.deutsch {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
}
.pin-icon-wrapper.deutsch svg {
    stroke: #2563eb;
}

.pin-icon-wrapper.science {
    background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
}
.pin-icon-wrapper.science svg {
    stroke: #059669;
}

.pin-icon-wrapper.kunst {
    background: linear-gradient(135deg, #fce7f3 0%, #f9a8d4 100%);
}
.pin-icon-wrapper.kunst svg {
    stroke: #db2777;
}

.pin-icon-wrapper.coding {
    background: linear-gradient(135deg, #ede9fe 0%, #c4b5fd 100%);
}
.pin-icon-wrapper.coding svg {
    stroke: #7c3aed;
}

.pin-icon-wrapper.natur {
    background: linear-gradient(135deg, #ecfccb 0%, #bef264 100%);
}
.pin-icon-wrapper.natur svg {
    stroke: #65a30d;
}

.pin-icon-wrapper.ki {
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 100%);
}
.pin-icon-wrapper.ki svg {
    stroke: #4f46e5;
}

/* Lock Overlay */
.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.pin-link.locked .lock-overlay {
    opacity: 1;
}

.pin-link.locked:hover .lock-overlay {
    background: rgba(139, 92, 246, 0.5);
}

.lock-overlay svg {
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Pin Content */
.pin-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pin-category {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.mathe {
    background: #fef3c7;
    color: #92400e;
}

.category-badge.deutsch {
    background: #dbeafe;
    color: #1e40af;
}

.category-badge.science {
    background: #d1fae5;
    color: #065f46;
}

.category-badge.kunst {
    background: #fce7f3;
    color: #9d174d;
}

.category-badge.coding {
    background: #ede9fe;
    color: #5b21b6;
}

.category-badge.natur {
    background: #ecfccb;
    color: #3f6212;
}

.category-badge.ki {
    background: #e0e7ff;
    color: #3730a3;
}

.featured-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 8px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pin-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
    margin: 0;
}

.pin-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pin-meta {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.meta-item svg {
    color: #8B5CF6;
}

/* Unlock Button */
.unlock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Load More Button */
.load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

/* Empty State */
.pinterest-library .empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #9ca3af;
}

.pinterest-library .empty-state svg {
    stroke: #d1d5db;
    margin-bottom: 1rem;
}

/* Animation für Cards */
.pin-card {
    animation: fadeInUp 0.6s ease-out both;
}

.pin-card:nth-child(1) { animation-delay: 0.05s; }
.pin-card:nth-child(2) { animation-delay: 0.1s; }
.pin-card:nth-child(3) { animation-delay: 0.15s; }
.pin-card:nth-child(4) { animation-delay: 0.2s; }
.pin-card:nth-child(5) { animation-delay: 0.25s; }
.pin-card:nth-child(6) { animation-delay: 0.3s; }
.pin-card:nth-child(7) { animation-delay: 0.35s; }
.pin-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hidden Cards (für Load More) */
.pin-card.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pinterest-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .pinterest-library {
        padding: 3rem 0;
    }
    
    .pinterest-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-search {
        width: 100%;
    }
    
    .filter-tags {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .filter-tag {
        flex-shrink: 0;
    }
    
    .age-select {
        width: 100%;
    }
    
    .pinterest-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .pin-card.short,
    .pin-card.medium,
    .pin-card.tall {
        grid-row: span 26;
    }
    
    .pin-icon-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .pin-icon-wrapper svg {
        width: 40px;
        height: 40px;
    }
    
    .pin-content {
        padding: 1rem;
    }
    
    .pin-title {
        font-size: 1rem;
    }
    
    .pin-description {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .pinterest-grid {
        grid-template-columns: 1fr;
    }
    
    .pin-card.short,
    .pin-card.medium,
    .pin-card.tall {
        grid-row: auto;
    }
}

/* Filter-Animation */
.pin-card.filter-hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
}

.pin-card.filter-visible {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}
