/* FACEIT Profile Viewer - Reusable Components */

/* ===== CARD COMPONENTS ===== */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    min-width: 200px;
}

.metric-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-sublabel {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.metric-icon.primary {
    background: rgba(65, 105, 225, 0.2);
    color: var(--accent-color);
}

.metric-icon.success {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
}

.metric-icon.warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
}

.metric-icon.error {
    background: rgba(220, 53, 69, 0.2);
    color: var(--error-color);
}

.content-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--card-shadow);
}

/* ===== FORM COMPONENTS ===== */
.search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    max-width: 600px;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    padding: 16px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.search-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.input-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== PLAYER COMPONENTS ===== */
.player-avatar-round {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.player-avatar-container {
    position: relative;
    display: inline-block;
}

.faceit-level-display {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.player-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.active {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.inactive {
    background: var(--error-color);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.country-flag {
    font-size: 1.2em;
    margin-right: 8px;
}

.elo-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elo-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-color);
}

.elo-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.elo-badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* ===== COMPARISON COMPONENTS ===== */
.comparison-player-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.comparison-player-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.comparison-elo-badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.vs-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* ===== STATUS & ALERT COMPONENTS ===== */
.status-alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-alert.normal {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-alert.warning {
    border-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.status-alert.critical {
    border-color: var(--error-color);
    background: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
}

.status-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-level {
    font-weight: 700;
    font-size: 1.1rem;
}

.status-details {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== PERFORMANCE INDICATORS ===== */
.good {
    color: var(--success-color) !important;
    font-weight: 600;
}

.positive {
    color: var(--success-color);
}

.negative {
    color: var(--error-color);
}

.neutral {
    color: var(--text-secondary);
}

/* ===== LOADING STATES ===== */
.loading-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.loading-text {
    margin-top: 16px;
    font-size: 14px;
}

/* ===== TOOLTIPS ===== */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip:hover::after {
    opacity: 1;
}

/* ===== RESPONSIVE COMPONENTS ===== */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .search-button {
        padding: 14px 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .player-avatar-round {
        width: 80px;
        height: 80px;
    }
    
    .faceit-level-display {
        width: 30px;
        height: 30px;
        font-size: 12px;
        bottom: -5px;
        right: -5px;
    }
    
    .comparison-player-profile {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .vs-circle {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .metric-card {
        min-width: auto;
        padding: 16px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding: 12px 16px;
    }
    
    .search-button {
        padding: 12px 16px;
        min-width: 100px;
    }
    
    .player-avatar-round {
        width: 60px;
        height: 60px;
    }
    
    .faceit-level-display {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .stat-card,
    .metric-card,
    .content-section {
        padding: 16px;
    }
    
    .vs-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}