/**
 * Coloring Page Cards - Styles v1.4.0
 */

/* ==================== Filters Wrapper ==================== */
.coloring-filters-wrapper {
    position: relative;
    width: 100%;
}

/* ==================== Filters ==================== */
.coloring-filters {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    z-index: 100;
    box-sizing: border-box;
}

/* Sticky filter styles - Desktop */
.coloring-filters.is-sticky {
    margin: 0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
}

.coloring-filters-placeholder {
    display: none;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.filter-btn {
    padding: 6px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #4A90D9;
    color: #4A90D9;
}

.filter-btn.active {
    background: #4A90D9;
    border-color: #4A90D9;
    color: #fff;
}

/* ==================== Cards Container ==================== */
.coloring-cards-container {
    width: 100%;
}

.coloring-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ==================== Card ==================== */
.coloring-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.coloring-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.coloring-card.hidden {
    display: none;
}

/* ==================== Card Image ==================== */
.card-image {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.card-image img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.coloring-card:hover .card-image img {
    transform: scale(1.03);
}

.card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
    pointer-events: none;
}

.card-image:hover::after {
    background: rgba(0, 0, 0, 0.03);
}

/* ==================== Card Content ==================== */
.card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

/* ==================== Card Meta ==================== */
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.difficulty-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FFF8E7;
    padding: 4px 10px;
    border-radius: 20px;
}

.stars {
    display: flex;
    gap: 1px;
}

.star {
    font-size: 14px;
    line-height: 1;
}

.star.filled {
    color: #F5A623;
}

.star.empty {
    color: #DDD;
}

.difficulty-label {
    font-size: 12px;
    color: #B8860B;
    font-weight: 500;
    margin-left: 4px;
}

/* ==================== Card Description ==================== */
.card-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

/* ==================== Card Footer ==================== */
.card-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #4A90D9 0%, #357ABD 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: linear-gradient(135deg, #357ABD 0%, #2868A9 100%);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

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

.icon-download {
    flex-shrink: 0;
}

.download-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
    transition: color 0.3s ease;
}

.download-count.updated {
    color: #4A90D9;
}

.icon-download-small {
    opacity: 0.6;
}

/* ==================== No Results ==================== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* ==================== Animation ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Responsive - Mobile ==================== */
@media (max-width: 768px) {
    .coloring-cards-grid {
        gap: 12px;
    }
    
    .coloring-card {
        border-radius: 12px;
    }
    
    .card-image {
        border-radius: 12px 12px 0 0;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .card-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .card-meta {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .difficulty-stars {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    .star {
        font-size: 12px;
    }
    
    .card-description {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .download-btn {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 8px;
    }
    
    /* Mobile filters - full width */
    .coloring-filters {
        padding: 12px;
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        border-radius: 0;
    }
    
    /* Mobile sticky - full width, no gaps */
    .coloring-filters.is-sticky {
        padding: 10px 15px;
        border-radius: 0;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-left: none;
        border-right: none;
    }
    
    .filter-group {
        gap: 6px;
    }
    
    .filter-label {
        font-size: 13px;
        margin-right: 6px;
    }
    
    .filter-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ==================== Very Small Screens ==================== */
@media (max-width: 400px) {
    .coloring-cards-grid {
        gap: 10px;
    }
    
    .card-image {
        border-radius: 10px 10px 0 0;
    }
    
    .card-content {
        padding: 10px;
    }
    
    .card-title {
        font-size: 13px;
    }
    
    .difficulty-label {
        display: none;
    }
    
    .filter-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}
