/**
 * Pokemon TCG Catalog & Comparison Styles
 */

/* ========== CATALOG WRAPPER ========== */
.tcg-catalog-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tcg-catalog-header {
    text-align: center;
    margin-bottom: 30px;
}

.tcg-catalog-header h2 {
    font-size: 2rem;
    color: #FFD700;
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tcg-catalog-header p {
    font-size: 1.05rem;
    color: #999;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

.tcg-catalog-header p strong {
    color: #FFD700;
}

/* ========== SEARCH BOX ========== */
.tcg-catalog-search {
    position: relative;
    margin-bottom: 25px;
}

.tcg-search-box {
    display: flex;
    align-items: center;
    background: #1e1e1e;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 0 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
}

.tcg-search-box:focus-within {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.tcg-search-icon {
    font-size: 1.3rem;
    margin-right: 12px;
    opacity: 0.6;
}

.tcg-search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1.05rem;
    padding: 16px 0;
    font-family: inherit;
    min-width: 0;
}

.tcg-search-box input::placeholder {
    color: #555;
}

.tcg-search-clear {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: #333;
    border: none;
    border-radius: 50%;
    color: #999;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tcg-search-clear:hover {
    background: #444;
    color: #fff;
}

/* ========== SEARCH RESULTS DROPDOWN ========== */
.tcg-search-results {
    display: none;
    position: absolute;
    top: calc(100% - 8px);
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0 0 12px 12px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 99;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.tcg-search-results.active {
    display: block;
}

.tcg-search-results::-webkit-scrollbar {
    width: 6px;
}

.tcg-search-results::-webkit-scrollbar-track {
    background: #111;
    border-radius: 3px;
}

.tcg-search-results::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.tcg-search-loading,
.tcg-search-empty {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 0.95rem;
}

.tcg-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid #FFD700;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search result item */
.tcg-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #222;
    outline: none;
}

.tcg-search-result-item:last-child {
    border-bottom: none;
}

.tcg-search-result-item:hover,
.tcg-search-result-item:focus {
    background: #222;
}

.tcg-search-result-item.selected {
    opacity: 0.6;
    background: #111;
}

.tcg-result-image {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #222;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcg-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tcg-result-placeholder {
    font-size: 1.5rem;
    opacity: 0.5;
}

.tcg-result-info {
    flex: 1;
    min-width: 0;
}

.tcg-result-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tcg-result-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
}

.tcg-result-cat {
    background: #2a2a2a;
    padding: 2px 8px;
    border-radius: 4px;
    color: #888;
}

.tcg-result-price {
    color: #FFD700;
    font-weight: 600;
}

.tcg-result-action {
    flex-shrink: 0;
}

.tcg-add-btn {
    background: #FFD700;
    color: #000;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.tcg-add-btn:hover {
    background: #ffed4a;
    transform: scale(1.05);
}

.tcg-checkmark {
    color: #4CAF50;
    font-size: 1.2rem;
}

.tcg-disabled {
    color: #555;
    font-size: 0.75rem;
}

/* ========== COMPARISON SLOTS ========== */
.tcg-comparison-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.tcg-slot {
    position: relative;
    min-height: 160px;
    background: #1a1a1a;
    border: 2px dashed #333;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.tcg-slot:hover {
    border-color: #444;
}

.tcg-slot.has-card {
    border-style: solid;
    border-color: #2a2a2a;
}

.tcg-slot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 20px;
    transition: all 0.2s;
}

.tcg-slot-placeholder:hover {
    transform: scale(1.05);
}

.tcg-slot-icon {
    font-size: 2rem;
    color: #555;
}

.tcg-slot-text {
    color: #555;
    font-size: 0.85rem;
    font-weight: 500;
}

.tcg-slot-card {
    display: none;
    width: 100%;
    height: 100%;
    padding: 15px;
    text-align: center;
}

.tcg-slot-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 10px;
    display: block;
    background: #222;
}

.tcg-slot-image-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    font-size: 2rem;
}

.tcg-slot-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-word;
}

.tcg-slot-price {
    color: #FFD700;
    font-weight: 700;
    font-size: 1rem;
}

.tcg-slot-remove {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    background: rgba(255,0,0,0.2);
    border: none;
    border-radius: 50%;
    color: #ff4444;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    z-index: 2;
}

.tcg-slot-remove:hover {
    background: rgba(255,0,0,0.4);
    color: #ff0000;
}

/* ========== REGIONAL TABS ========== */
.tcg-regional-tabs {
    display: none;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tcg-region-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #888;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.tcg-region-btn:hover {
    border-color: #555;
    color: #ccc;
}

.tcg-region-btn.active {
    background: #FFD700;
    color: #000;
    border-color: #FFD700;
    font-weight: 600;
}

/* ========== COMPARISON TABLE ========== */
.tcg-comparison-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.tcg-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.tcg-comparison-table th,
.tcg-comparison-table td {
    padding: 14px 18px;
    text-align: center;
    border-bottom: 1px solid #222;
}

.tcg-comparison-table th {
    background: #111;
    font-weight: 600;
    font-size: 0.9rem;
}

.tcg-comparison-table thead th {
    border-bottom: 2px solid #333;
}

.tcg-compare-feature {
    font-weight: 600;
    color: #888;
    text-align: left !important;
    font-size: 0.85rem;
    white-space: nowrap;
    background: #151515;
    position: sticky;
    left: 0;
}

.tcg-compare-header {
    min-width: 200px;
    padding: 20px 18px !important;
}

.tcg-compare-header-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcg-compare-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tcg-compare-header-placeholder {
    font-size: 2rem;
}

.tcg-compare-header-name {
    font-size: 0.9rem;
    color: #fff;
    line-height: 1.3;
}

.tcg-compare-cell {
    color: #ccc;
    font-size: 0.9rem;
}

.price-cell {
    color: #FFD700 !important;
    font-weight: 700;
    font-size: 1.1rem !important;
}

.regional-cell {
    color: #aaa;
}

.sku-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #666;
}

.trend-up {
    color: #4CAF50 !important;
}

.trend-down {
    color: #f44336 !important;
}

.desc-cell {
    font-size: 0.85rem;
    color: #999;
    max-width: 250px;
    line-height: 1.5;
}

/* View button */
.tcg-view-btn {
    display: inline-block;
    background: #FFD700;
    color: #000;
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.tcg-view-btn:hover {
    background: #ffed4a;
    transform: scale(1.05);
}

/* Alternating row colors */
.tcg-comparison-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

.tcg-comparison-table tbody tr:hover {
    background: rgba(255,215,0,0.03);
}

/* ========== EMPTY STATE ========== */
.tcg-catalog-empty {
    text-align: center;
    padding: 60px 20px;
}

.tcg-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.tcg-catalog-empty h3 {
    color: #ccc;
    font-size: 1.5rem;
    margin: 0 0 10px;
}

.tcg-catalog-empty p {
    color: #666;
    max-width: 400px;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== NOTIFICATIONS ========== */
.tcg-notification {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    text-align: center;
}

.tcg-notification-success {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.tcg-notification-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.tcg-notification-info {
    background: rgba(33, 150, 243, 0.15);
    color: #42A5F5;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.tcg-notification-fade {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== MARKET DATA (embedded) ========== */
.tcg-market-data {
    display: grid;
    gap: 6px;
}

.tcg-market-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    font-size: 0.85rem;
}

.tcg-market-name {
    flex: 1;
    color: #ccc;
}

.tcg-market-price {
    color: #FFD700;
    font-weight: 600;
}

.tcg-market-change {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 60px;
    text-align: center;
}

.tcg-market-change.positive {
    background: rgba(76,175,80,0.15);
    color: #4CAF50;
}

.tcg-market-change.negative {
    background: rgba(244,67,54,0.15);
    color: #f44336;
}

.tcg-market-vol {
    color: #666;
    font-size: 0.75rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .tcg-catalog-header h2 {
        font-size: 1.5rem;
    }

    .tcg-comparison-slots {
        grid-template-columns: repeat(2, 1fr);
    }

    .tcg-slot {
        min-height: 130px;
    }

    .tcg-compare-header {
        min-width: 150px;
    }

    .tcg-compare-header-image {
        width: 60px;
        height: 60px;
    }

    .tcg-compare-feature {
        font-size: 0.75rem;
        padding: 10px 12px;
    }

    .tcg-compare-cell {
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .tcg-region-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .tcg-comparison-slots {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .tcg-slot {
        min-height: 100px;
    }

    .tcg-slot-image,
    .tcg-slot-image-placeholder {
        width: 50px;
        height: 50px;
    }

    .tcg-slot-name {
        font-size: 0.75rem;
    }

    .tcg-search-box input {
        font-size: 0.95rem;
        padding: 14px 0;
    }
}
