/**
 * Public-facing styles for TCG Packers plugin
 * 
 * @package TCG_Packers
 * @since 1.0.0
 */

/* Card Components */
.tcg-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
}

.tcg-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.tcg-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f3f4f6;
}

.tcg-card-body {
    padding: 1rem;
}

.tcg-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.tcg-card-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Search Components */
.tcg-search-container {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.tcg-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tcg-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tcg-set-filter,
.tcg-rarity-filter {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tcg-set-filter:focus,
.tcg-rarity-filter:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tcg-search-button {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tcg-search-button:hover {
    background-color: #2563eb;
}

.tcg-search-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Grid Layouts */
.tcg-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tcg-search-results {
    margin-top: 2rem;
}

/* Rarity Badges */
.tcg-rarity-common {
    background-color: #f3f4f6;
    color: #374151;
}

.tcg-rarity-uncommon {
    background-color: #d1fae5;
    color: #065f46;
}

.tcg-rarity-rare {
    background-color: #dbeafe;
    color: #1e40af;
}

.tcg-rarity-rare-holo {
    background-color: #e9d5ff;
    color: #6b21a8;
}

.tcg-rarity-rare-ultra {
    background-color: #fef3c7;
    color: #92400e;
}

/* Loading States */
.tcg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.tcg-spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: tcg-spin 1s linear infinite;
}

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

/* Modal Styles */
.tcg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.tcg-modal-content {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.tcg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.tcg-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.tcg-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: background-color 0.2s, color 0.2s;
}

.tcg-modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

/* Pagination */
.tcg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.tcg-pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.tcg-pagination button:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.tcg-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tcg-pagination button.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tcg-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .tcg-search-container {
        padding: 1rem;
    }
    
    .tcg-modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .tcg-card-body {
        padding: 0.75rem;
    }
    
    .tcg-card-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .tcg-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .tcg-card-image {
        height: 150px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tcg-card {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .tcg-card-title {
        color: #f9fafb;
    }
    
    .tcg-card-text {
        color: #d1d5db;
    }
    
    .tcg-search-container {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .tcg-search-input,
    .tcg-set-filter,
    .tcg-rarity-filter {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .tcg-search-input:focus,
    .tcg-set-filter:focus,
    .tcg-rarity-filter:focus {
        border-color: #3b82f6;
    }
    
    .tcg-modal-content {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .tcg-modal-header {
        border-bottom-color: #374151;
    }
    
    .tcg-modal-title {
        color: #f9fafb;
    }
    
    .tcg-modal-close {
        color: #d1d5db;
    }
    
    .tcg-modal-close:hover {
        background-color: #374151;
        color: #f9fafb;
    }
    
    .tcg-pagination button {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .tcg-pagination button:hover:not(:disabled) {
        background-color: #4b5563;
    }
}

/* Utility Classes */
.tcg-text-center {
    text-align: center;
}

.tcg-text-left {
    text-align: left;
}

.tcg-text-right {
    text-align: right;
}

.tcg-mb-4 {
    margin-bottom: 1rem;
}

.tcg-mt-4 {
    margin-top: 1rem;
}

.tcg-p-4 {
    padding: 1rem;
}

.tcg-hidden {
    display: none;
}

.tcg-block {
    display: block;
}

.tcg-inline-block {
    display: inline-block;
}

.tcg-flex {
    display: flex;
}

.tcg-items-center {
    align-items: center;
}

.tcg-justify-center {
    justify-content: center;
}

.tcg-justify-between {
    justify-content: space-between;
}

.tcg-gap-4 {
    gap: 1rem;
}

.tcg-w-full {
    width: 100%;
}

.tcg-h-full {
    height: 100%;
}

/* Animation Classes */
.tcg-fade-in {
    animation: tcg-fade-in 0.3s ease-in-out;
}

@keyframes tcg-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tcg-slide-up {
    animation: tcg-slide-up 0.3s ease-out;
}

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