/* ===== Decks Page Styles ===== */

.decks-container {
    width: 100%;
    padding: 8px 0 32px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-title-section {
    flex: 1;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

/* Filters */
.decks-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.search-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
}

.sort-select select {
    padding: 10px 40px 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.sort-select select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Decks Section */
.decks-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.section-title svg {
    color: var(--primary);
}

.section-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.section-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.section-link:hover {
    color: var(--primary-dark);
}

/* Decks Grid */
.decks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Deck Card */
.deck-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.deck-card:hover {
    transform: translateY(-6px);
}

.deck-card-inner {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--card-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Abstract Background Circles */
.deck-card-inner::before,
.deck-card-inner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.deck-card-inner::before {
    width: 150px;
    height: 150px;
    background: var(--primary);
    opacity: 0.08;
    top: -50px;
    right: -50px;
}

.deck-card-inner::after {
    width: 100px;
    height: 100px;
    background: var(--secondary);
    opacity: 0.06;
    bottom: -30px;
    left: -30px;
}

.deck-card:hover .deck-card-inner::before {
    transform: translate(10px, 10px);
}

.deck-card:hover .deck-card-inner::after {
    transform: translate(-10px, -10px);
}

/* New Deck Card */
.deck-card-new {
    border: 2px dashed var(--border-color);
    background: transparent;
}

.deck-card-new .deck-card-inner {
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 12px;
}

.deck-card-new .deck-card-inner::before,
.deck-card-new .deck-card-inner::after {
    display: none;
}

.new-deck-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.deck-card-new:hover .new-deck-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.new-deck-text {
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.deck-card-new:hover .new-deck-text {
    color: var(--primary);
}

/* Deck Header */
.deck-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
    flex-wrap: wrap;
}

.deck-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.deck-badge.official {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.deck-badge.mine {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.deck-badge.premium {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
}

.deck-badge.free {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.deck-badge.family {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.deck-badge.new {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.deck-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.deck-card:hover .deck-actions {
    opacity: 1;
}

.deck-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.deck-action-btn:hover {
    background: var(--primary);
    color: white;
}

.deck-action-btn:last-child:hover {
    background: #ef4444;
}

/* Deck Author */
.deck-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.deck-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
}

.deck-author span {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Deck Preview */
.deck-preview {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.preview-card {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    line-height: 1.4;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.preview-card p {
    margin: 0;
}

.preview-card.black {
    background: #1a1a2e;
    color: white;
}

.preview-card.white {
    background: white;
    color: #1a1a2e;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .preview-card.white {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Deck Info */
.deck-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--text-primary);
}

.deck-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

/* Deck Stats */
.deck-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.deck-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.deck-stat svg {
    color: var(--text-muted);
}

.deck-stat.published {
    color: #10b981;
}

.deck-stat.published svg {
    color: #10b981;
}

.deck-stat.price {
    color: var(--primary);
    font-weight: 600;
}

.deck-stat.price svg {
    color: var(--primary);
}

/* Deck Rating */
.deck-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.stars {
    display: flex;
    gap: 2px;
    color: #fbbf24;
}

.stars svg {
    width: 14px;
    height: 14px;
}

.rating-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Buy Button */
.deck-buy-btn {
    margin-top: auto;
}

/* Featured Deck */
.deck-card-official.featured {
    grid-column: span 1;
}

.deck-card-official.featured .deck-card-inner::before {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0.1;
}

/* Premium Deck Glow */
.deck-card-premium .deck-card-inner {
    border: 2px solid transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, #f59e0b, #f97316) border-box;
}

.deck-card-premium .deck-card-inner::before {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    opacity: 0.1;
}

/* Responsive */
@media (max-width: 768px) {
    .decks-container {
        padding: 20px 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header .btn {
        width: 100%;
    }

    .decks-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-wrapper {
        max-width: none;
    }

    .filter-tabs {
        overflow-x: auto;
        padding-bottom: 8px;
        flex-wrap: nowrap;
    }

    .filter-tab {
        white-space: nowrap;
    }

    .sort-select {
        width: 100%;
    }

    .sort-select select {
        width: 100%;
    }

    .decks-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    .deck-preview {
        flex-direction: column;
    }

    .deck-stats {
        flex-wrap: wrap;
        gap: 10px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ===== My Decks Page ===== */

.deck-card-my .deck-actions {
    opacity: 1;
}

.deck-card-my .deck-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.deck-badge.public {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.deck-badge.private {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.deck-badge.nsfw {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    margin-bottom: 24px;
}

.empty-icon i {
    font-size: 2.5rem;
    color: var(--text-muted);
}

.empty-state h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0 0 24px 0;
    color: var(--text-muted);
}

.deck-name-to-delete {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 8px;
}

/* ===== Category Filters ===== */
.category-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.category-pill {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.category-pill:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.category-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-pill i {
    margin-right: 6px;
}

/* Category icons */
.category-pill[data-category="deck-humor"] i::before { content: "\f599"; }
.category-pill[data-category="deck-adult"] i::before { content: "\f21d"; }
.category-pill[data-category="deck-movies"] i::before { content: "\f008"; }
.category-pill[data-category="deck-gaming"] i::before { content: "\f11b"; }
.category-pill[data-category="deck-music"] i::before { content: "\f001"; }
.category-pill[data-category="deck-science"] i::before { content: "\f0c3"; }

@media (max-width: 768px) {
    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        margin-bottom: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-filters::-webkit-scrollbar {
        display: none;
    }

    .category-pill {
        flex-shrink: 0;
    }
}
