/* Deck Tile Components - Shared across My Decks and Public Decks */

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

/* Deck Card Container */
.deck-card {
    background: var(--card-bg, white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 2px solid transparent;
}

.deck-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.deck-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Deck Card Header */
.deck-card-header {
    padding: 15px 20px 10px;
}

.deck-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    margin: 0;
    line-height: 1.3;
}

/* Deck Colors Row */
.deck-colors-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 20px 12px 20px;
    padding: 0;
    flex-wrap: wrap;
}

.deck-colors {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 20px 12px 20px;
    padding: 0;
    background: transparent;
    border: none;
    align-items: center;
}

.no-colors {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

/* Deck Color Badges */
.deck-color-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background-color: #95a5a6;
    text-transform: capitalize;
    white-space: nowrap;
}

.deck-color-badge.Red { background-color: var(--card-color-red); }
.deck-color-badge.Blue { background-color: var(--card-color-blue); }
.deck-color-badge.Green { background-color: var(--card-color-green); }
.deck-color-badge.Yellow { background-color: var(--card-color-yellow); color: #333; }
.deck-color-badge.Purple { background-color: var(--card-color-purple); }
.deck-color-badge.White { background-color: var(--card-color-white); color: #333; border: 1px solid #bdc3c7; }
.deck-color-badge.Black { background-color: var(--card-color-black); }

/* Deck Labels Row */
.deck-labels-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 20px;
}

.deck-label-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary, #2c3e50);
    background-color: var(--card-footer-bg, #f8f9fa);
    border: 1px solid var(--border-color, #ddd);
    white-space: nowrap;
}

/* Status Badges */
.deck-status-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.complete {
    background: #d4edda;
    color: #155724;
}

.status-badge.incomplete {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.public {
    background: #cce5ff;
    color: #004085;
}

.status-badge.private {
    background: #e2e6ea;
    color: #495057;
}

/* Deck Description */
.deck-description {
    color: var(--text-secondary, #666);
    font-size: 14px;
    line-height: 1.4;
    margin: 0 20px 12px 20px;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39.2px; /* 2 lines: 14px font-size × 1.4 line-height × 2 lines */
}

/* Deck Info Section */
.deck-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

/* Deck Stats */
.deck-stats {
    display: flex;
    gap: 15px;
    align-items: center;
    margin: 0 20px 12px 20px;
    padding: 0;
    font-size: 13px;
    color: var(--text-secondary, #666);
}

.deck-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.deck-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    line-height: 1;
}

.deck-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-count {
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
}

.unique-count {
    color: var(--text-secondary, #666);
}

/* Deck Meta (Dates) */
.deck-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary, #999);
    margin: 0 20px 12px 20px;
    padding: 0;
}

.creation-date,
.updated-date {
    font-size: 12px;
    color: var(--text-secondary, #999);
}

/* Deck Footer */
.deck-footer {
    min-height: 60px;
    padding: 15px 20px;
    background: var(--card-footer-bg, #f8f9fa);
    border-top: 1px solid var(--border-color, #eee);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.deck-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.deck-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.deck-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

/* Creator Info in Footer */
.deck-footer-left .creator-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #e9ecef);
    flex-shrink: 0;
}

.deck-footer-left .creator-name {
    font-size: 12px;
    color: var(--text-secondary, #666);
    font-weight: 500;
    line-height: 20px;
}

/* Deck Rating */
.deck-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stars {
    display: flex;
    gap: 2px;
    align-items: center;
}

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

.star.filled {
    color: #ffd700;
}

.rating-count {
    font-size: 11px;
    color: var(--text-secondary, #666);
    line-height: 20px;
}

/* Deck Action Buttons */
.deck-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    background: var(--bg-primary, white);
    color: var(--text-primary, #2c3e50);
    border: 1px solid var(--border-color, #ddd);
}

.deck-action-btn:hover {
    background: var(--card-footer-bg, #f8f9fa);
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-1px);
}

.deck-action-btn.primary {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.deck-action-btn.primary:hover {
    background: #2980b9;
}

.deck-action-btn.secondary {
    background: #95a5a6;
    color: white;
    border-color: #95a5a6;
}

.deck-action-btn.secondary:hover {
    background: #7f8c8d;
}

.deck-action-btn.danger {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.deck-action-btn.danger:hover {
    background: #c0392b;
}

/* Dark Theme Support */
body.dark-theme .deck-card {
    background: var(--card-bg, #2c3e50);
    border-color: var(--border-color, #34495e);
}

body.dark-theme .deck-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: #3498db;
}

body.dark-theme .deck-title {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .deck-description {
    color: var(--text-secondary, #bdc3c7);
}

body.dark-theme .deck-label-badge {
    background-color: var(--bg-secondary, #2c3e50);
    color: var(--text-primary, #ecf0f1);
    border-color: var(--border-color, #34495e);
}

body.dark-theme .deck-footer {
    background: var(--card-footer-bg, #34495e);
    border-top-color: var(--border-color, #2c3e50);
}

body.dark-theme .deck-action-btn {
    background: var(--bg-secondary, #34495e);
    color: var(--text-primary, #ecf0f1);
    border-color: var(--border-color, #2c3e50);
}

body.dark-theme .deck-action-btn:hover {
    background: var(--card-footer-bg, #2c3e50);
    border-color: #3498db;
}

body.dark-theme .card-count {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .unique-count,
body.dark-theme .creation-date,
body.dark-theme .updated-date {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .deck-footer-left .creator-name {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .rating-count {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .star {
    color: #555;
}

body.dark-theme .star.filled {
    color: #ffd700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .decks-grid {
        grid-template-columns: 1fr;
    }

    .deck-footer {
        flex-direction: column;
        gap: 10px;
        height: auto;
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .deck-card-header {
        padding: 15px;
    }

    .deck-info {
        padding: 12px 15px;
    }

    .deck-footer {
        padding: 12px 15px;
    }
}
