/* Deck Builder Styles */

.deck-builder {
    padding: 20px;
    max-height: 100vh;
    overflow-y: auto;
}

.deck-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.deck-title {
    font-size: 2.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.deck-actions {
    display: flex;
    gap: 10px;
}

/* Deck Builder Layout */
.deck-builder-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
}

/* Card Browser Section */
.deck-browser-section {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
}

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

.deck-section-header h2 {
    font-size: 1.3em;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.deck-filters-compact {
    display: flex;
    gap: 8px;
}

.filter-select-small,
.filter-input-small {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    font-size: 0.85em;
    transition: all 0.2s;
}

.filter-select-small:hover,
.filter-input-small:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.filter-select-small:focus,
.filter-input-small:focus {
    outline: none;
    border-color: #667eea;
}

.filter-input-small {
    width: 150px;
}

/* Card Pool */
.deck-card-pool {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
    margin-top: 10px;
}

/* Compact TCG Card for Deck Builder */
.deck-card-compact {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.95), rgba(20, 20, 30, 0.95));
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-height: 140px;
}

.deck-card-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.6;
}

.deck-card-compact.common { color: #9ca3af; }
.deck-card-compact.rare { color: #60a5fa; }
.deck-card-compact.epic { color: #a78bfa; }
.deck-card-compact.legendary { color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }

.deck-card-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: currentColor;
}

.deck-card-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.deck-card-compact-type {
    font-size: 1.2em;
}

.deck-card-compact-cost {
    background: rgba(102, 126, 234, 0.3);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
}

.deck-card-compact-kanji {
    font-size: 2em;
    text-align: center;
    margin: 6px 0;
    font-weight: bold;
    color: white;
}

.deck-card-compact-meaning {
    text-align: center;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
}

.deck-card-compact-ability {
    font-size: 0.65em;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.2;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-card-compact-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

/* Deck List Section */
.deck-list-section {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
}

.deck-stats-compact {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.deck-stat-item {
    color: rgba(255, 255, 255, 0.7);
}

.deck-stat-item strong {
    color: #667eea;
    font-size: 1.1em;
}

/* Deck Stats Panel */
.deck-stats-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.deck-stat-row {
    margin-bottom: 12px;
}

.deck-stat-row:last-child {
    margin-bottom: 0;
}

.deck-stat-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deck-stat-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.deck-type-breakdown {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.deck-type-badge {
    background: rgba(102, 126, 234, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.deck-type-badge-icon {
    font-size: 1.1em;
}

/* Cost Curve */
.deck-cost-curve {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 60px;
}

.deck-cost-bar {
    flex: 1;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 4px;
    transition: all 0.3s;
}

.deck-cost-bar:hover {
    background: rgba(102, 126, 234, 0.5);
}

.deck-cost-bar-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.5);
}

.deck-cost-bar-count {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    color: white;
    font-weight: bold;
}

/* Deck Card List */
.deck-card-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.deck-cost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 10px 0 5px 0;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.deck-cost-label {
    font-weight: bold;
    color: #667eea;
    font-size: 0.9em;
}

.deck-cost-count {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
}

.deck-list-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.deck-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.5);
}

.deck-list-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.deck-list-item-kanji {
    font-size: 1.8em;
    font-weight: bold;
}

.deck-list-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.deck-list-item-name {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.9);
}

.deck-list-item-ability {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
}

.deck-list-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deck-list-item-cost {
    background: rgba(102, 126, 234, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
}

.deck-list-item-remove {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
}

.deck-list-item-remove:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Empty State */
.deck-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.deck-empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.3;
}

.deck-empty-text {
    font-size: 1em;
    line-height: 1.6;
}

.deck-empty-text small {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.3);
}

/* Deck Validation */
.deck-validation {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.deck-validation.valid {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.deck-validation.invalid {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.validation-icon {
    font-size: 1.2em;
}

.validation-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive */
@media (max-width: 1024px) {
    .deck-builder-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .deck-browser-section {
        max-height: 50vh;
    }

    .deck-card-pool {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .deck-builder-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .deck-filters-compact {
        flex-direction: column;
        width: 100%;
    }

    .filter-input-small {
        width: 100%;
    }

    .deck-card-pool {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
