/**
 * Transfer Portal Tracker - Styles
 * AppSheet-like interface with team branding
 */

/* Reset & Base */
#transfer-portal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #0f0f0f;
    color: #ffffff;
    min-height: 100vh;
}

/* Loading State */
.portal-loading {
    text-align: center;
    padding: 100px 20px;
}

.spinner {
    border: 4px solid rgba(207, 184, 124, 0.2);
    border-top: 4px solid var(--primary-color, #CFB87C);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Header */
.portal-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--primary-color, #CFB87C), var(--secondary-color, #000));
    border-radius: 12px;
    margin-bottom: 30px;
}

.portal-logo {
    max-width: 100px;
    margin-bottom: 15px;
}

.portal-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.portal-subtitle {
    margin: 10px 0 0 0;
    font-size: 1.1rem;
    opacity: 0.9;
    color: #fff;
}

/* Tabs */
.portal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    color: #b8b8b8;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #2a2a2a;
    border-color: var(--primary-color, #CFB87C);
}

.tab-btn.active {
    background: var(--primary-color, #CFB87C);
    border-color: var(--primary-color, #CFB87C);
    color: #000;
}

/* Controls */
.portal-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 2;
    min-width: 200px;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color, #CFB87C);
}

.filter-select {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color, #CFB87C);
}

.export-btn,
.refresh-btn {
    padding: 12px 20px;
    background: var(--primary-color, #CFB87C);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.export-btn:hover,
.refresh-btn:hover {
    transform: scale(1.05);
}

.refresh-btn {
    background: #2a2a2a;
    color: #fff;
}

/* Player Count */
.player-count {
    text-align: center;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color, #CFB87C);
}

/* Archetype Sections */
.archetype-section {
    margin-bottom: 40px;
}

.archetype-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color, #CFB87C);
    border-bottom: 3px solid var(--primary-color, #CFB87C);
    padding-bottom: 10px;
}

/* Player Grid */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Player Card */
.player-card {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.player-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color, #CFB87C);
    box-shadow: 0 8px 24px rgba(207, 184, 124, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #fff;
}

.position-badge {
    background: var(--primary-color, #CFB87C);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.card-body p {
    margin: 8px 0;
    color: #b8b8b8;
}

.player-stats {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff !important;
    margin: 12px 0 !important;
}

.archetype-label {
    color: var(--primary-color, #CFB87C) !important;
    font-weight: 600;
    font-size: 0.95rem;
}

.card-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.save-btn,
.remove-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn {
    background: var(--primary-color, #CFB87C);
    color: #000;
}

.save-btn:hover {
    transform: scale(1.05);
}

.remove-btn {
    background: #d32f2f;
    color: #fff;
}

.remove-btn:hover {
    background: #b71c1c;
}

/* Table View */
.table-container {
    overflow-x: auto;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
}

.players-table th {
    background: var(--primary-color, #CFB87C);
    color: #000;
    padding: 15px;
    text-align: left;
    font-weight: 700;
    position: sticky;
    top: 0;
}

.players-table td {
    padding: 15px;
    border-bottom: 1px solid #2a2a2a;
    color: #b8b8b8;
}

.players-table tr:hover {
    background: #2a2a2a;
}

.archetype-badge {
    background: #2a2a2a;
    color: var(--primary-color, #CFB87C);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #1a1a1a;
    border-radius: 12px;
}

.empty-state p {
    font-size: 1.2rem;
    color: #b8b8b8;
}

/* Error State */
.portal-error {
    text-align: center;
    padding: 80px 20px;
    background: #1a1a1a;
    border-radius: 12px;
}

.portal-error h3 {
    color: #f44336;
    font-size: 2rem;
    margin-bottom: 15px;
}

.portal-error p {
    color: #b8b8b8;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.retry-btn {
    padding: 15px 40px;
    background: var(--primary-color, #CFB87C);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .portal-header h1 {
        font-size: 1.8rem;
    }
    
    .portal-controls {
        flex-direction: column;
    }
    
    .search-input,
    .filter-select,
    .export-btn,
    .refresh-btn {
        width: 100%;
    }
    
    .player-grid {
        grid-template-columns: 1fr;
    }
    
    .players-table {
        font-size: 14px;
    }
    
    .players-table th,
    .players-table td {
        padding: 10px;
    }
}

/* Install Prompt (from previous PWA code) */
.pwa-install-banner {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color, #CFB87C), #000);
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
    z-index: 10000;
    transition: bottom 0.3s ease;
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-install-btn {
    background: white;
    color: #000;
    border: none;
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
