/**
 * Zentangle Extensions - Frontend Styles
 */

/* Tangle Archive (Library) Grid */
.tangle-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.tangle-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.tangle-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.tangle-card-image {
    position: relative;
    overflow: hidden;
    padding-top: 75%; /* 4:3 aspect ratio */
    background: #f5f5f5;
}

.tangle-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tangle-card-content {
    padding: 20px;
}

.tangle-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.tangle-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.tangle-card-title a:hover {
    color: #0073aa;
}

.tangle-difficulty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.tangle-difficulty-beginner {
    background: #4caf50;
    color: white;
}

.tangle-difficulty-easy {
    background: #8bc34a;
    color: white;
}

.tangle-difficulty-intermediate {
    background: #ff9800;
    color: white;
}

.tangle-difficulty-advanced {
    background: #ff5722;
    color: white;
}

.tangle-difficulty-expert {
    background: #f44336;
    color: white;
}

.tangle-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.tangle-price {
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
}

.tangle-price-sale {
    color: #f44336;
}

.tangle-price-regular {
    text-decoration: line-through;
    font-size: 14px;
    color: #999;
    margin-left: 5px;
}

.tangle-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}

.tangle-badge-free {
    background: #4caf50;
}

.tangle-badge-purchased {
    background: #2196f3;
}

.tangle-badge-locked {
    background: #ff9800;
}

/* Favorite Button */
.tangle-favorite-button {
    display: inline-flex;
    align-items: center;
    background: #f0f0f0;
    border: 2px solid #ddd;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.3s;
}

.tangle-favorite-button:hover {
    background: #e0e0e0;
    border-color: #0073aa;
}

.tangle-favorite-button.favorited {
    background: #fff3e0;
    border-color: #ff9800;
    color: #ff9800;
}

.tangle-favorite-button.favorited:hover {
    background: #ffe0b2;
}

.tangle-favorite-button .favorite-icon {
    font-size: 20px;
    margin-right: 8px;
    transition: transform 0.3s;
}

.tangle-favorite-button:hover .favorite-icon {
    transform: scale(1.2);
}

/* Single Tangle Page */
.tangle-full-content,
.tangle-preview-content {
    margin-bottom: 30px;
}

.tangle-details-box {
    background: #f9f9f9;
    padding: 25px;
    margin: 30px 0;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.tangle-step-by-step {
    margin: 30px 0;
}

.tangle-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.tangle-gallery-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.tangle-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.tangle-gallery-item:hover img {
    transform: scale(1.05);
}

.step-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 1;
}

/* Filters */
.tangle-filters {
    background: #f5f5f5;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.tangle-filter-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.tangle-filter-group label {
    display: inline-block;
    margin-right: 8px;
    font-weight: 600;
}

.tangle-filter-group select,
.tangle-filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .tangle-archive-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .tangle-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .tangle-filter-group {
        display: block;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .tangle-archive-grid {
        grid-template-columns: 1fr;
    }

    .tangle-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
