/* Search and Modal Styles */

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.no-results {
    color: #6c757d;
    font-style: italic;
    cursor: default;
}

.suggestion-item.no-results:hover {
    background-color: white;
}

.suggestion-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1rem;
}

.suggestion-text {
    flex: 1;
}

.suggestion-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.suggestion-details {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Card Details Modal */
.card-details-modal {
    padding: 2rem;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 2rem;
}

.card-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.card-set {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.card-image {
    max-width: 200px;
    max-height: 280px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Grading Recommendation */
.grading-recommendation {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid #dee2e6;
}

.grading-recommendation.highly_recommended {
    background: #d4edda;
    border-left-color: #28a745;
}

.grading-recommendation.recommended {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.grading-recommendation.maybe {
    background: #f8d7da;
    border-left-color: #fd7e14;
}

.grading-recommendation.not_recommended {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.grading-recommendation h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.recommendation-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.recommendation-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Population and Price Sections */
.population-section,
.price-section {
    margin-bottom: 2rem;
}

.population-section h3,
.price-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.population-total {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Search Results */
.search-results {
    padding: 2rem;
}

.search-results h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
}

.card-thumbnail {
    width: 60px;
    height: 84px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1rem;
}

.card-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.card-info p {
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.card-price {
    color: #28a745;
    font-weight: 600;
}

/* Set List Styles */
.set-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.set-item {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.set-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.set-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.set-year {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.set-card-count {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 1rem;
}

.set-actions {
    text-align: center;
}

/* Grade Item Styling */
.grade-item {
    border-color: #dee2e6 !important;
    transition: all 0.3s ease;
}

.grade-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.grade-item[data-grade="10"] {
    border-color: #28a745 !important;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
}

.grade-item[data-grade="9"] {
    border-color: #20c997 !important;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%) !important;
}

.grade-item[data-grade="8"] {
    border-color: #17a2b8 !important;
    background: linear-gradient(135deg, #d6f5ff 0%, #b8e6ff 100%) !important;
}

/* Loading States */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 5px;
    height: 1rem;
    margin-bottom: 0.5rem;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Error States */
.error-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.error-state h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.retry-btn {
    margin-top: 1rem;
}

/* Responsive Design for Search */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .card-details-modal {
        padding: 1rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .search-suggestions {
        font-size: 0.9rem;
    }
    
    .suggestion-item {
        padding: 0.75rem;
    }
    
    .suggestion-image {
        width: 35px;
        height: 35px;
    }
    
    .card-thumbnail {
        width: 50px;
        height: 70px;
    }
    
    .set-list {
        grid-template-columns: 1fr;
    }
    
    .grade-data {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .card-header .card-image {
        max-width: 150px;
        max-height: 210px;
    }
    
    .grade-data {
        grid-template-columns: 1fr;
    }
    
    .card-actions .btn {
        width: 100%;
    }
} 