/**
 * OddsEkspert - League Sidebar Styles
 *
 * Modern, competitor-inspired design based on Flashscore/SofaScore UX patterns
 * Features: Collapsible countries, search filter, smooth animations
 */

/* ===========================================
   LEAGUE SIDEBAR CONTAINER
   =========================================== */

.oe-league-sidebar {
    background: var(--oe-color-white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: sticky;
    top: 20px;
}

/* Header with gradient accent */
.oe-league-sidebar__header {
    background: linear-gradient(135deg, var(--oe-color-primary) 0%, var(--oe-color-primary-dark) 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.oe-league-sidebar__title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oe-league-sidebar__title-icon {
    font-size: 18px;
}

/* Legacy support - title without header wrapper */
.oe-league-sidebar > .oe-league-sidebar__title {
    background: linear-gradient(135deg, var(--oe-color-primary) 0%, var(--oe-color-primary-dark) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    padding: 14px 20px;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.oe-league-sidebar > .oe-league-sidebar__title::before {
    content: "⚽";
    font-size: 16px;
}

/* ===========================================
   SEARCH FILTER (Optional Enhancement)
   =========================================== */

.oe-league-sidebar__search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--oe-color-bg-alt);
}

.oe-league-sidebar__search-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid var(--oe-color-border);
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: var(--oe-color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
}

.oe-league-sidebar__search-input:focus {
    outline: none;
    border-color: var(--oe-color-primary);
    background-color: var(--oe-color-white);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.oe-league-sidebar__search-input::placeholder {
    color: var(--oe-color-text-light);
}

/* ===========================================
   LEAGUE LIST
   =========================================== */

.oe-league-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 8px 12px 12px;
}

/* ===========================================
   COUNTRY HEADERS - Collapsible
   =========================================== */

.oe-league-sidebar__country-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--oe-color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 12px 8px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
    list-style: none;
}

.oe-league-sidebar__country-header:first-child {
    padding-top: 4px;
}

.oe-league-sidebar__country-header:hover {
    color: var(--oe-color-primary);
}

/* Country flag emoji */
.oe-league-sidebar__country-flag {
    width: 18px;
    height: 13px;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

.oe-league-sidebar__country-list {
    list-style: none;
    margin: 0 0 8px 0;
    padding: 0;
}

/* ===========================================
   LEAGUE ITEMS
   =========================================== */

.oe-league-sidebar__item {
    margin: 2px 0;
}

.oe-league-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--oe-color-text-dark);
    border-radius: 8px;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.oe-league-sidebar__link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--oe-color-primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
    border-radius: 0 2px 2px 0;
}

.oe-league-sidebar__link:hover {
    background: var(--oe-color-bg);
    color: var(--oe-color-primary);
    transform: translateX(2px);
}

.oe-league-sidebar__link:hover::before {
    transform: scaleY(1);
}

/* Active state */
.oe-league-sidebar__item--active .oe-league-sidebar__link {
    background: linear-gradient(135deg, var(--oe-color-primary) 0%, var(--oe-color-primary-dark) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.oe-league-sidebar__item--active .oe-league-sidebar__link::before {
    display: none;
}

.oe-league-sidebar__item--active .oe-league-sidebar__link:hover {
    transform: none;
    background: linear-gradient(135deg, var(--oe-color-primary-dark) 0%, #004a6e 100%);
}

/* ===========================================
   LEAGUE LOGO
   =========================================== */

.oe-league-sidebar__logo-wrapper {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--oe-color-bg);
    border-radius: 6px;
    padding: 4px;
    transition: all 0.2s ease;
}

.oe-league-sidebar__link:hover .oe-league-sidebar__logo-wrapper {
    background: var(--oe-color-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.oe-league-sidebar__item--active .oe-league-sidebar__logo-wrapper {
    background: rgba(255, 255, 255, 0.2);
}

.oe-league-sidebar__logo {
    max-width: 20px;
    max-height: 20px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.oe-league-sidebar__logo-placeholder {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--oe-color-border) 0%, var(--oe-color-bg-alt) 100%);
    border-radius: 4px;
}

/* ===========================================
   LEAGUE INFO (NAME + ROUND)
   =========================================== */

.oe-league-sidebar__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.oe-league-sidebar__name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oe-league-sidebar__round {
    font-size: 10px;
    color: var(--oe-color-text-light);
    font-weight: 400;
    line-height: 1.2;
}

.oe-league-sidebar__item--active .oe-league-sidebar__round {
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================================
   BADGES (MATCHES & TIPS COUNTS)
   =========================================== */

.oe-league-sidebar__badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.oe-league-sidebar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

/* Matches badge - blue/gray */
.oe-league-sidebar__badge--matches {
    background: var(--oe-color-primary-tint);
    color: var(--oe-color-primary);
}

/* Tips badge - green highlight */
.oe-league-sidebar__badge--tips {
    background: linear-gradient(135deg, var(--oe-color-success) 0%, var(--oe-color-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.3);
}

/* Badge styling for active item */
.oe-league-sidebar__item--active .oe-league-sidebar__badge--matches {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.oe-league-sidebar__item--active .oe-league-sidebar__badge--tips {
    background: rgba(255, 255, 255, 0.9);
    color: var(--oe-color-success);
    box-shadow: none;
}

/* Hover effects for badges */
.oe-league-sidebar__link:hover .oe-league-sidebar__badge--matches {
    background: var(--oe-color-primary-tint);
}

/* ===========================================
   EMPTY STATE
   =========================================== */

.oe-league-sidebar__empty {
    color: var(--oe-color-text-light);
    font-size: 14px;
    text-align: center;
    padding: 30px 20px;
}

.oe-league-sidebar__empty::before {
    content: "🏟️";
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS
   =========================================== */

@media (max-width: 768px) {
    .oe-league-sidebar {
        position: static;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--oe-color-border);
    }

    .oe-league-sidebar > .oe-league-sidebar__title {
        padding: 12px 16px;
        font-size: 14px;
    }

    .oe-league-sidebar__link {
        padding: 12px 10px;
    }

    .oe-league-sidebar__name {
        font-size: 14px;
    }

    .oe-league-sidebar__country-header {
        padding: 14px 8px 8px;
        font-size: 12px;
    }

    .oe-league-sidebar__round {
        font-size: 9px;
    }

    .oe-league-sidebar__badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        padding: 0 5px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .oe-league-sidebar__link {
        padding: 14px 12px;
    }

    .oe-league-sidebar__link:hover {
        transform: none;
    }

    .oe-league-sidebar__link:active {
        background: var(--oe-color-primary-tint);
    }

}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
    .oe-league-sidebar {
        display: none;
    }
}
