/* Utility Components - Shared utilities, loading states, empty states */

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 200px;
    color: var(--text-secondary, #666);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color, #f3f3f3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Error States */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #e74c3c;
}

.error-message p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #666);
}

.error-state h3 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-state p {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Empty States */
.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #666);
}

.empty-content {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.empty-content h2,
.empty-state h3 {
    margin: 0 0 15px 0;
    color: var(--text-primary, #2c3e50);
}

.empty-content p {
    color: var(--text-secondary, #666);
    margin-bottom: 25px;
}

/* Login Prompt */
.not-logged-in {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.login-prompt {
    text-align: center;
    background: var(--card-bg, white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.login-prompt h2 {
    margin: 0 0 15px 0;
    color: var(--text-primary, #2c3e50);
}

.login-prompt p {
    color: var(--text-secondary, #666);
    margin-bottom: 25px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Sort Options */
.sort-options {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Progress Bars */
.progress-bar {
    background: var(--border-color, #e9ecef);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.stat-progress {
    margin-top: 10px;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-size: 14px;
    color: var(--text-secondary, #666);
    min-width: 80px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.progress-percentage {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    min-width: 40px;
    text-align: right;
}

/* Page Actions */
.page-actions {
    display: flex;
    gap: 15px;
}

/* Collection Controls */
.collection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Deck Filters */
.deck-filters {
    background: var(--card-bg, white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    width: 100%;
    display: block;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

/* Deck Stats Summary */
.deck-stats-summary {
    color: var(--text-secondary, #666);
    font-size: 14px;
}

/* Card Stats */
.card-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
}

.card-stats span {
    background: var(--card-footer-bg, #f8f9fa);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary, #666);
}

/* Creator Info */
.creator-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #e9ecef);
}

.creator-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #e9ecef);
}

.creator-name {
    font-size: 14px;
    color: var(--text-secondary, #666);
    font-weight: 500;
}

.creator-name-small {
    font-size: 14px;
    color: var(--text-secondary, #666);
    font-weight: 500;
}

/* Card Number Display */
.card-number {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary, #6c757d);
    font-size: 12px;
    margin-left: 8px;
}

/* Rarity Badges */
.card-rarity {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.card-rarity.C { background-color: #7f8c8d; }
.card-rarity.U { background-color: #16a085; }
.card-rarity.R { background-color: #2980b9; }
.card-rarity.RR { background-color: #8e44ad; }
.card-rarity.SR { background-color: #d35400; }
.card-rarity.UR { background-color: #c0392b; }
.card-rarity.LR { background-color: #34495e; }
.card-rarity.P { background-color: #e67e22; }

/* Dark Theme Support */
body.dark-theme .loading-spinner {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .spinner {
    border-color: var(--border-color, #34495e);
    border-top-color: #3498db;
}

body.dark-theme .empty-content h2,
body.dark-theme .empty-state h3 {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .empty-content p,
body.dark-theme .empty-state p {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .login-prompt {
    background: var(--card-bg, #2c3e50);
}

body.dark-theme .login-prompt h2 {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .login-prompt p {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .deck-filters {
    background: var(--card-bg, #2c3e50);
}

body.dark-theme .card-stats span {
    background: var(--card-footer-bg, #34495e);
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .progress-bar {
    background: var(--border-color, #34495e);
}

body.dark-theme .progress-label {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .progress-percentage {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .creator-avatar,
body.dark-theme .creator-avatar-small {
    border-color: var(--border-color, #2c3e50);
}

body.dark-theme .creator-name,
body.dark-theme .creator-name-small {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .card-number {
    color: var(--text-secondary, #95a5a6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-spinner {
        padding: 40px 20px;
    }

    .empty-state {
        min-height: 300px;
        padding: 40px 15px;
    }

    .collection-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination {
        justify-content: center;
        gap: 5px;
    }

    .card-stats {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .sort-options {
        gap: 5px;
    }
}

/* ============================================
   Coming Soon Page Styles
   ============================================ */

.coming-soon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.coming-soon-content {
    text-align: center;
    max-width: 500px;
}

.coming-soon-icon {
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.coming-soon-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.coming-soon-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

.coming-soon-features {
    background: var(--surface-secondary);
    border-radius: var(--radius-lg, 12px);
    padding: 1.5rem;
    text-align: left;
    margin-bottom: 2rem;
}

.coming-soon-features h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coming-soon-features ul {
    margin: 0;
    padding-left: 1.25rem;
}

.coming-soon-features li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.coming-soon-features li:last-child {
    margin-bottom: 0;
}

.coming-soon-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md, 8px);
    font-weight: 500;
    transition: background 0.2s;
}

.coming-soon-btn:hover {
    background: var(--color-primary-hover, #2563eb);
    color: white;
    text-decoration: none;
}

@media (max-width: 480px) {
    .coming-soon-title {
        font-size: 1.5rem;
    }

    .coming-soon-description {
        font-size: 0.9375rem;
    }
}
