/**
 * WP Sports API - Public Styles
 * Version: 1.0.0
 */

/* Widget Container */
.wp-sports-api-widget-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
    overflow: hidden;
}

/* Widget Types - Minimum Heights */
.wp-sports-api-standings {
    min-height: 400px;
}

.wp-sports-api-fixtures {
    min-height: 400px;
}

.wp-sports-api-livescore {
    min-height: 500px;
}

/* API Sports Widget Custom Element Styling */
api-sports-widget {
    display: block;
    width: 100%;
}

/* Config widget should be hidden */
api-sports-widget[data-type="config"] {
    display: none;
}

/* Error Messages */
.wp-sports-api-error {
    padding: 15px;
    margin: 20px 0;
    background: #fff5f5;
    border: 1px solid #e0b4b4;
    border-left: 4px solid #d63638;
    border-radius: 4px;
    color: #d63638;
}

.wp-sports-api-error strong {
    display: block;
    margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-sports-api-widget {
        margin: 15px 0;
    }
    
    .wp-sports-api-loader {
        min-height: 250px;
        padding: 30px 20px;
    }
}

/* Widget iframe styling (if needed) */
.wp-sports-api-widget iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Hide widget when loading completes */
.wp-sports-api-widget.loaded .wp-sports-api-loader {
    display: none;
}

/* Accessibility */
.wp-sports-api-widget:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .wp-sports-api-widget {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .wp-sports-api-loader {
        display: none;
    }
}

/* ========================================
   LEAGUES LIST STYLES
======================================== */

/* Container */
.wp-sports-leagues-container {
    max-width: 100%;
    margin: 20px 0;
}

/* Search Box - Compact */
.wp-sports-leagues-search {
    position: relative;
    margin-bottom: 15px;
}

.wp-sports-leagues-search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    font-size: 14px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    transition: all 0.2s ease;
    background: #fff;
}

.wp-sports-leagues-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.wp-sports-leagues-search-input::placeholder {
    color: #a7aaad;
    font-size: 13px;
}

.wp-sports-leagues-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a7aaad;
    font-size: 18px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Loading State */
.wp-sports-leagues-loading {
    text-align: center;
    padding: 40px;
}

.wp-sports-leagues-loading p {
    margin-top: 15px;
    color: #646970;
}

/* Leagues List - Single Column Accordion */
.wp-sports-leagues-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Country Group - Compact Accordion */
.wp-sports-leagues-country-group {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

/* Country Title - Accordion Header */
.wp-sports-leagues-country-title {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 5px 14px;
    background: #f9f9f9;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.wp-sports-leagues-country-title:hover {
    background: #f0f0f1;
}

.wp-sports-leagues-country-title:active {
    background: #e6e7e8;
}

.wp-sports-leagues-country-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.wp-sports-leagues-country-name {
    flex: 1;
}

.wp-sports-leagues-count {
    font-size: 10px;
    line-height: 11px;
    font-weight: 500;
    background: #0000008c;
    color: #fff;
    padding: 4px 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

.wp-sports-leagues-accordion-arrow {
    flex-shrink: 0;
    color: #646970;
    transition: transform 0.2s ease;
}

.wp-sports-leagues-accordion-arrow .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.wp-sports-leagues-country-title[aria-expanded="true"] .wp-sports-leagues-accordion-arrow {
    transform: rotate(180deg);
}

.wp-sports-leagues-country-title[aria-expanded="true"] {
    background: #f0f6fc !important;
    border-bottom: 1px solid #e0e0e0;
}

.wp-sports-leagues-country-title[aria-expanded="true"] .wp-sports-leagues-count {
    background: #a6a6a6;
}

/* League Items Container */
.wp-sports-leagues-items {
    display: flex;
    flex-direction: column;
}

/* Individual League Item - Compact */
.wp-sports-leagues-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #1d2327;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.15s ease;
    background: #fff;
}

.wp-sports-leagues-item:last-child {
    border-bottom: none;
}

.wp-sports-leagues-item:hover {
    background: #f9f9f9;
    padding-left: 18px;
}

.wp-sports-leagues-item:hover .wp-sports-leagues-arrow {
    opacity: 1;
    transform: translateX(3px);
}

.wp-sports-leagues-item:active {
    background: #f0f6fc;
}

/* League Logo - Compact */
.wp-sports-leagues-logo {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.wp-sports-leagues-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.wp-sports-leagues-logo-placeholder {
    background: linear-gradient(135deg, #f0f6fc 0%, #e6f0f9 100%);
    border-color: #c3d9ed;
}

.wp-sports-leagues-logo-placeholder .dashicons {
    color: #2271b1;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* League Info - Compact */
.wp-sports-leagues-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.wp-sports-leagues-name {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: #1d2327;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0 !important;
}

.wp-sports-leagues-type {
    font-size: 11px;
    color: #8c8f94;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.2px;
    display: none; /* Hide to save space */
}

/* Arrow Icon - Subtle */
.wp-sports-leagues-arrow {
    flex-shrink: 0;
    opacity: 0;
    transition: all 0.2s ease;
    color: #8c8f94;
}

.wp-sports-leagues-arrow .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* No Results - Compact */
.wp-sports-leagues-no-results {
    text-align: center;
    padding: 30px 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.wp-sports-leagues-no-results .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #c3c4c7;
    margin-bottom: 10px;
}

.wp-sports-leagues-no-results p {
    margin: 0 0 15px 0;
    color: #646970;
    font-size: 13px;
}

.wp-sports-leagues-clear-search {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    font-size: 13px;
    padding: 6px 14px;
}

.wp-sports-leagues-clear-search:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-sports-leagues-item {
        padding: 7px 12px;
    }

    .wp-sports-leagues-item:hover {
        padding-left: 16px;
    }

    .wp-sports-leagues-logo {
        width: 28px;
        height: 28px;
    }

    .wp-sports-leagues-name {
        font-size: 12px;
    }

    .wp-sports-leagues-search-input {
        font-size: 13px;
        padding: 9px 36px 9px 12px;
    }

    .wp-sports-leagues-country-title {
        padding: 9px 12px;
        font-size: 12px;
    }

    .wp-sports-leagues-country-flag {
        width: 18px;
        height: 12px;
    }
}

/* Accessibility */
.wp-sports-leagues-item:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
    background: #f0f6fc;
}

/* Filtered States */
.wp-sports-leagues-country-group.filtered-out {
    display: none;
}

.wp-sports-leagues-country-group.filtered-in {
    animation: fadeInLeague 0.3s ease;
}

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

