/* ========================================
 * Teams Browse Page Layout
 * Page-specific styles for /team/browse
 * ======================================== */

.teams-browse {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* Header */
.teams-browse-header {
    margin-bottom: 24px;
}

.teams-browse-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.teams-browse-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 4px 0 0;
}

/* Controls */
.teams-browse-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.teams-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.teams-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
    pointer-events: none;
}

.teams-search-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.teams-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.teams-search-input:focus {
    border-color: var(--cta-primary);
    box-shadow: 0 0 0 3px rgba(var(--cta-primary-rgb, 59, 130, 246), 0.15);
}

.teams-result-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Pill Bar */
.teams-pill-bar {
    position: relative;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    /* Fade edges on scroll */
    mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 24px), transparent 100%);
}

.teams-pill-bar::-webkit-scrollbar {
    display: none;
}

/* Remove fade mask when not scrollable */
.teams-pill-bar.no-overflow {
    mask-image: none;
    -webkit-mask-image: none;
}

.teams-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.teams-pill:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.teams-pill:focus-visible {
    outline: 2px solid var(--cta-primary);
    outline-offset: 2px;
}

.teams-pill.active {
    background-color: var(--cta-primary, #3b82f6);
    border-color: var(--cta-primary, #3b82f6);
    color: #fff;
}

.teams-pill.active .teams-pill-count {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.teams-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 9999px;
    background-color: var(--bg-secondary, rgba(128, 128, 128, 0.12));
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s ease;
}

/* Card Grid */
.teams-card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Empty State */
.teams-empty-state {
    text-align: center;
    padding: 64px 24px;
}

.teams-empty-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    opacity: 0.4;
    margin-bottom: 16px;
}

.teams-empty-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.teams-empty-reset {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 20px;
    color: var(--cta-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.teams-empty-reset:hover {
    background-color: var(--bg-card);
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .teams-card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .teams-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .teams-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .teams-search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .teams-search-input {
        max-width: none;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .teams-result-count {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .teams-browse {
        padding: 16px 12px 32px;
    }

    .teams-card-grid {
        gap: 10px;
    }

    .teams-pill {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    .teams-pill-count {
        min-width: 18px;
        height: 18px;
        font-size: 0.68rem;
    }
}
