/* Price Refresh Popup Styles */

.price-refresh-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.price-refresh-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

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

.price-refresh-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-refresh-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.price-refresh-close {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.price-refresh-close:hover {
    background-color: #f0f0f0;
}

.price-refresh-body {
    padding: 20px;
}

.price-refresh-card-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.price-refresh-card-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.price-refresh-card-id {
    color: #666;
    font-size: 0.9em;
}

.price-refresh-card-id .tcg-id-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.price-refresh-card-id .tcg-id-link:hover {
    text-decoration: underline;
}

.price-refresh-loading {
    text-align: center;
    padding: 40px 20px;
}

.price-refresh-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.price-refresh-loading-text {
    color: #666;
}

.price-refresh-error {
    background-color: #fee;
    border: 1px solid #fcc;
    padding: 15px;
    border-radius: 4px;
    color: #c33;
    margin-bottom: 15px;
}

.price-refresh-error-title {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Set TCGPlayer ID section */
.price-refresh-set-id {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff;
    border: 2px solid #3498db;
    border-radius: 6px;
}

.set-id-title {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.set-id-help {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.set-id-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.set-id-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
}

.set-id-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.set-id-button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.set-id-button:hover:not(:disabled) {
    background-color: #2980b9;
}

.set-id-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.set-id-status {
    font-size: 0.9em;
    min-height: 20px;
    font-weight: 500;
}

.price-refresh-data {
    display: grid;
    gap: 15px;
}

.price-refresh-section {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.price-refresh-section-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.price-refresh-items {
    display: grid;
    gap: 10px;
}

.price-refresh-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.price-refresh-item-label {
    color: #666;
    font-size: 0.95em;
}

.price-refresh-item-value {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.price-refresh-item-value.primary {
    color: #2ecc71;
    font-size: 1.2em;
}

.price-refresh-item-value.highlight {
    color: #3498db;
}

.price-refresh-item-value.unavailable {
    color: #999;
    font-style: italic;
    font-weight: normal;
}

.price-refresh-item-value .price-min {
    color: #27ae60;
    font-weight: bold;
}

.price-refresh-item-value .price-max {
    color: #e74c3c;
    font-weight: bold;
}

.price-refresh-shipping {
    font-size: 0.8em;
    font-style: italic;
    color: #666;
    font-weight: normal;
    margin-top: 4px;
}

.price-refresh-footer {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: right;
}

.price-refresh-footer-text {
    color: #999;
    font-size: 0.85em;
}

/* Price clickable styling */
.price-clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    transition: color 0.2s;
}

.price-clickable:hover {
    color: #3498db;
}

/* TCGPlayer Search Section */
.tcgplayer-search-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff;
    border: 2px solid #3498db;
    border-radius: 6px;
}

.tcgplayer-search-title {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.tcgplayer-search-help {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.tcgplayer-search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tcgplayer-search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
}

.tcgplayer-search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.tcgplayer-search-button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.tcgplayer-search-button:hover:not(:disabled) {
    background-color: #2980b9;
}

.tcgplayer-search-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.tcgplayer-search-status {
    font-size: 0.9em;
    min-height: 20px;
    font-weight: 500;
    margin-bottom: 15px;
}

.tcgplayer-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 5px;
}

.tcgplayer-result-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.tcgplayer-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.tcgplayer-result-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.tcgplayer-result-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tcgplayer-result-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tcgplayer-result-name {
    font-weight: bold;
    color: #333;
    font-size: 0.95em;
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tcgplayer-result-set {
    color: #666;
    font-size: 0.85em;
    font-style: italic;
}

.tcgplayer-result-price {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1em;
}

.tcgplayer-result-button {
    padding: 10px 15px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9em;
}

.tcgplayer-result-button:hover:not(:disabled) {
    background-color: #27ae60;
}

.tcgplayer-result-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* Responsive design */
@media (max-width: 600px) {
    .price-refresh-popup {
        width: 95%;
        max-height: 90vh;
    }

    .price-refresh-header {
        padding: 15px;
    }

    .price-refresh-header h3 {
        font-size: 1.2em;
    }

    .price-refresh-body {
        padding: 15px;
    }

    .price-refresh-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .price-refresh-item-value {
        font-size: 1em;
    }

    .set-id-controls {
        flex-direction: column;
    }

    .set-id-input {
        width: 100%;
    }

    .set-id-button {
        width: 100%;
    }

    .tcgplayer-search-controls {
        flex-direction: column;
    }

    .tcgplayer-search-input {
        width: 100%;
    }

    .tcgplayer-search-button {
        width: 100%;
    }

    .tcgplayer-search-results {
        grid-template-columns: 1fr;
    }
}
