/* ================================================ */
/*  TEAMS PAGE - WHITE LABEL THEME AWARE           */
/*  Uses CSS variables from theme-system.css       */
/* ================================================ */

/* ================================================ */
/*  TEAMS PAGE STYLES - Padel and Go Tournament    */
/*  Follows home page design with glow effects     */
/* ================================================ */

main {
    overflow: visible !important;
}

/* ===== HERO SECTION WITH ENHANCED GRADIENT ===== */
.hero-teams {
    position: relative;
    background: var(--bg-primary);
    overflow: visible;
    padding: 8rem 0 4rem;
    min-height: 40vh;
    display: flex;
    align-items: center;
}

/* Top-left glow - matching home page */
.hero-teams::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -15%;
    width: 60%;
    height: 80%;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-secondary), 0.15) 0%,
        rgba(255, 217, 0, 0.08) 30%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
    animation: pulse-glow 8s ease-in-out infinite;
    filter: blur(60px);
}

/* Bottom-right subtle glow */
.hero-teams::after {
    content: "";
    position: absolute;
    bottom: -20%;
    right: -15%;
    width: 50%;
    height: 60%;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-primary), 0.1) 0%,
        color-mix(in srgb, var(--accent-primary), 0.05) 30%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 1;
    animation: pulse-glow 8s ease-in-out infinite 4s;
    filter: blur(60px);
}

.hero-teams > * {
    position: relative;
    z-index: 3;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* ===== SEARCH SECTION WITH GLOW ===== */
.search-section {
    position: relative;
    overflow: visible;
}

.search-section::before {
    content: "";
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        color-mix(in srgb, var(--accent-primary), 0.08) 0%,
        color-mix(in srgb, var(--accent-primary), 0.04) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
}

.search-section > * {
    position: relative;
    z-index: 1;
}

/* ===== COMPACT SEARCH COMPONENTS ===== */
.search-wrapper {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-secondary), 0.1), 0 0 30px color-mix(in srgb, var(--accent-secondary), 0.2);
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
}

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

/* ===== CATEGORY TABS ===== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-tab {
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.category-tab::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-secondary), 0.1) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-tab:hover {
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    transform: translateY(-2px);
}

.category-tab:hover::before {
    opacity: 1;
}

.category-tab.active {
    background: transparent;
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 15px color-mix(in srgb, var(--accent-secondary), 0.3);
}

.category-tab i {
    font-size: 0.875rem;
}

/* ===== MOBILE SELECT ===== */
.mobile-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.mobile-select:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-secondary), 0.1);
    background: color-mix(in srgb, var(--bg-secondary) 90%, transparent);
}

.mobile-select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===== TEAMS CONTAINER WITH GLOW ===== */
.teams-container {
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-radius: 1.5rem;
    padding: 1.5rem;
    position: relative;
    overflow: visible;
    margin-bottom: 2rem;
}

/* Glow behind container */
.teams-container::before {
    content: "";
    position: absolute;
    inset: -20px;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-primary), 0.08) 0%,
        color-mix(in srgb, var(--accent-secondary), 0.06) 40%,
        transparent 70%
    );
    z-index: -1;
    opacity: 0.6;
    filter: blur(40px);
    pointer-events: none;
    border-radius: inherit;
}

/* Dot pattern */
.teams-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.teams-container > * {
    position: relative;
    z-index: 2;
}

/* ===== CATEGORY SECTION ===== */
.category-section {
    margin-bottom: 2rem;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
}

.category-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--accent-secondary), 0.3);
}

.category-icon i {
    color: var(--bg-primary);
    font-size: 1rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
}

.category-count {
    color: #999;
    font-size: 0.875rem;
    margin-left: auto;
}

/* ===== TEAM CARDS WITH HOVER GLOW ===== */
.team-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

/* Glow effect on hover */
.team-card::before {
    content: "";
    position: absolute;
    inset: -10px;
    background: radial-gradient(
        circle at center,
        color-mix(in srgb, var(--accent-primary), 0.15) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(20px);
    pointer-events: none;
    border-radius: inherit;
}

/* Dot pattern */
.team-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 2px 2px, color-mix(in srgb, var(--text-primary) 3%, transparent) 1px, transparent 0);
    background-size: 15px 15px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.team-card > * {
    position: relative;
    z-index: 2;
}

.team-card:hover {
    background: var(--bg-tertiary);
    border-color: color-mix(in srgb, var(--accent-secondary), 0.4);
    transform: translateX(3px);
    box-shadow: var(--shadow-lg);
}

.team-card:hover::before {
    opacity: 1;
}

.team-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.team-players {
    flex: 1;
    min-width: 0;
}

.team-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-category {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.group-badge {
    background: color-mix(in srgb, var(--accent-secondary), 0.1);
    color: var(--accent-secondary);
    border: 1px solid color-mix(in srgb, var(--accent-secondary), 0.3);
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.team-card:hover .group-badge {
    background: color-mix(in srgb, var(--accent-secondary), 0.2);
    border-color: color-mix(in srgb, var(--accent-secondary), 0.5);
    box-shadow: 0 0 15px color-mix(in srgb, var(--accent-secondary), 0.3);
}

/* ===== SEARCH RESULTS ===== */
.search-results {
    margin-bottom: 2rem;
}

.search-results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: white;
}

.search-results-header i {
    color: var(--accent-secondary);
    font-size: 1.25rem;
}

.search-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.search-table th {
    background: color-mix(in srgb, var(--accent-secondary), 0.1);
    border-bottom: 1px solid color-mix(in srgb, var(--accent-secondary), 0.2);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.search-table td {
    padding: 0.75rem;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    color: var(--text-primary);
}

.search-table tbody tr {
    transition: all 0.3s ease;
}

.search-table tbody tr:hover {
    background: color-mix(in srgb, var(--bg-tertiary) 60%, transparent);
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent-primary), 0.1);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 30px color-mix(in srgb, var(--accent-secondary), 0.3);
    animation: float 3s ease-in-out infinite;
}

.empty-icon i {
    color: #000;
    font-size: 2rem;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===== SECTION GLOW EFFECTS ===== */
.teams-main-section {
    position: relative;
    overflow: visible;
}

/* Diagonal glow for teams section */
.teams-main-section::before {
    content: "";
    position: absolute;
    top: 20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(
        ellipse at center,
        color-mix(in srgb, var(--accent-secondary), 0.08) 0%,
        color-mix(in srgb, var(--accent-secondary), 0.04) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}

.teams-main-section > * {
    position: relative;
    z-index: 1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-teams {
        padding: 6rem 0 3rem;
        min-height: 50vh;
    }
    
    .category-tabs {
        display: none;
    }
    
    .category-title {
        font-size: 1.25rem;
    }
    
    .team-name {
        font-size: 0.875rem;
    }
    
    .group-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.625rem;
    }
    
    .teams-container {
        padding: 1rem;
    }
    
    /* Reduce glow intensity on mobile */
    .hero-teams::before,
    .hero-teams::after,
    .search-section::before,
    .teams-main-section::before {
        opacity: 0.5;
    }
    
    .teams-container::before,
    .team-card::before {
        opacity: 0.4;
    }
}

@media (min-width: 769px) {
    .mobile-select {
        display: none;
    }
}

/* ===== LOADING ANIMATIONS ===== */
.category-content {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ACCESSIBILITY ===== */
.search-input:focus,
.mobile-select:focus,
.category-tab:focus {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .hero-teams::before,
    .hero-teams::after,
    .search-section,
    .category-tabs,
    .teams-container::before,
    .team-card::before {
        display: none;
    }
    
    .team-card {
        break-inside: avoid;
    }
}

/* ===== ICON ALIGNMENT FIX ===== */
/* This fixes alignment issues in circular icon containers and empty states */

/* Fix for all circular icon containers */
.empty-icon,
.category-icon,
.compact-team-icon,
.no-groups-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important; /* Remove inherited line-height */
}

/* Fix for FontAwesome icons inside circular containers */
.empty-icon i,
.category-icon i,
.compact-team-icon i,
.no-groups-icon i {
    display: block; /* Make icon a block element */
    line-height: 1 !important; /* Reset line-height */
    vertical-align: middle; /* Center vertically */
    margin: 0 !important; /* Remove any margins */
    padding: 0 !important; /* Remove any padding */
}

/* Specific fix for empty state icon */
.empty-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin: 0 auto 1rem; /* Center horizontally and add space below */
    box-shadow: 0 8px 30px color-mix(in srgb, var(--accent-secondary), 0.3);
}

.empty-icon i {
    color: #000;
    font-size: 2rem;
}

/* Fix for empty state text alignment */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state h3,
.empty-state p {
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center;
}

/* Fix for category section empty state */
.category-section .empty-state {
    padding: 2rem 1rem;
}

.category-section .empty-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.75rem;
}

.category-section .empty-icon i {
    font-size: 1.5rem;
}

/* Fix for groups page icons */
.compact-position-indicator {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* Fix for team icons in table rows */
.compact-table-row .compact-team-icon {
    flex-shrink: 0; /* Prevent icon from shrinking */
}

/* Fix for search results icons */
.search-results-header i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Fix for dropdown icons */
.dropdown-item-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    flex-shrink: 0;
}

/* General fix for all circular badges/icons */
[class*="-icon"] {
    line-height: 1;
}

[class*="-icon"] i,
[class*="-icon"] svg {
    display: block;
    margin: 0;
    padding: 0;
}

/* Fix for mobile icon alignment */
@media (max-width: 768px) {
    .empty-icon {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .empty-icon i {
        font-size: 1.75rem;
    }
}

/* Additional fix for category header icons */
.category-header {
    display: flex;
    align-items: center; /* Ensure all items in header are vertically centered */
    gap: 0.75rem;
}

.category-header .category-icon {
    flex-shrink: 0; /* Prevent icon from being squished */
}

/* Fix for group header icons in groups page */
.compact-group-header .h-8.w-8 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    flex-shrink: 0;
}

.compact-group-header .h-8.w-8 i {
    display: block;
    line-height: 1;
}

/* Fix for any floating/animated icons */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Ensure animated icons stay centered */
.empty-icon.float,
.no-groups-icon.float {
    transform-origin: center center;
}