/* Trigger Styles */
.tcg-search-trigger {
    background: #f0f2f5;
    border: 2px solid #e1e4e8;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    max-width: 500px;
    margin: 20px 0;
}

.tcg-search-trigger:hover {
    border-color: #007cba;
    background: #fff;
}

.tcg-icon { margin-right: 10px; font-size: 1.2em; }
.tcg-placeholder { color: #666; font-size: 1em; }

/* Modal Base */
.tcg-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999;
    display: none;
    align-items: flex-end; /* Bottom sheet by default */
}

.tcg-modal.active { display: flex; }

.tcg-modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
}

.tcg-modal-content {
    position: relative;
    background: #fff;
    width: 100%;
    height: 85vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tcg-modal.active .tcg-modal-content { transform: translateY(0); }

/* Desktop Adjustment */
@media (min-width: 768px) {
    .tcg-modal { align-items: center; justify-content: center; }
    .tcg-modal-content {
        width: 600px;
        height: 70vh;
        border-radius: 16px;
        transform: scale(0.9);
        opacity: 0;
        transition: all 0.2s ease;
    }
    .tcg-modal.active .tcg-modal-content { transform: scale(1); opacity: 1; }
}

/* Header & Search */
.tcg-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.tcg-drag-handle {
    width: 40px; height: 5px; background: #ddd;
    border-radius: 10px; margin: 0 auto 15px;
}

@media (min-width: 768px) { .tcg-drag-handle { display: none; } }

.tcg-modal-close {
    position: absolute; right: 15px; top: 15px;
    background: none; border: none; font-size: 24px; cursor: pointer; color: #999;
}

#tcg-search-input {
    width: 100%; padding: 12px 15px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 16px; outline: none;
}

#tcg-search-input:focus { border-color: #007cba; box-shadow: 0 0 0 2px rgba(0,124,186,0.1); }

/* Body & Results */
.tcg-modal-body { flex: 1; overflow-y: auto; padding: 20px; }

.tcg-trending-section p { margin: 0 0 10px; font-weight: bold; color: #444; }
.tcg-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tcg-pill {
    background: #f0f2f5; padding: 6px 12px; border-radius: 20px;
    font-size: 14px; cursor: pointer; transition: background 0.2s;
}
.tcg-pill:hover { background: #e1e4e8; }

/* Card Styles */
.tcg-card-link { text-decoration: none; color: inherit; display: block; }

.tcg-card {
    display: flex; gap: 15px; padding: 15px;
    border: 1px solid #eee; border-radius: 12px; margin-bottom: 15px;
    background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    position: relative;
}

.tcg-card-link:hover .tcg-card {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.1);
}

.tcg-card-img { width: 80px; height: auto; border-radius: 4px; object-fit: contain; }

.tcg-card-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.tcg-card-name { font-weight: bold; font-size: 16px; margin-bottom: 2px; }
.tcg-card-number { font-size: 12px; color: #888; margin-bottom: 8px; }

.tcg-pricing { display: flex; align-items: baseline; gap: 10px; }
.tcg-market-price { font-size: 24px; font-weight: 900; color: #222; }
.tcg-mid-price { font-size: 14px; color: #888; text-decoration: line-through; }

.tcg-badge {
    display: inline-block; background: #e6fffa; color: #234e52;
    padding: 2px 8px; border-radius: 4px; font-size: 11px;
    font-weight: bold; margin-top: 5px; align-self: flex-start;
}

.tcg-analysis-link {
    margin-top: 10px; font-size: 12px; color: #007cba; font-weight: bold;
}

/* Skeleton Loader */
.tcg-skeleton {
    background: #f6f7f8;
    background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
    border-radius: 12px; height: 110px; margin-bottom: 15px;
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}
