/**
 * Bongda Odds Widget Styles
 * 
 * All CSS classes use the bdow- prefix to avoid conflicts with WordPress themes
 * Validates: Requirements 1.4, 6.1, 6.2, 6.3
 */

/* ============================================
   Container Styles
   ============================================ */

.bdow-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    box-sizing: border-box;
}

/* ============================================
   Navigation Styles
   ============================================ */

.bdow-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    margin-bottom: 10px;
}

.bdow-nav-button {
    padding: 5px 10px;
    text-decoration: none;
    color: #fff;
    background: #00603a !important;
    border: none;
    border-radius: 5px;
    line-height: 1;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    outline: none;
    transition: background 0.2s ease;
}

.bdow-nav-button:hover {
    background: #45a049 !important;
}

.bdow-nav-button:focus {
    outline: 2px solid #00603a;
    outline-offset: 2px;
}

.bdow-nav-button.active {
    background: #2e7d32 !important;
}

.bdow-nav-button[data-type="live"] {
    background: red !important;
}

.bdow-nav-button[data-type="live"]:hover {
    background: #cc0000 !important;
}

/* ============================================
   Loading States
   ============================================ */

.bdow-loading {
    text-align: center;
    padding: 40px;
}

.bdow-loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: bdow-spin 1s linear infinite;
}

@keyframes bdow-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Refresh Indicator
   ============================================ */

.bdow-refresh-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 1000;
}

.bdow-refresh-icon {
    display: inline-block;
    animation: bdow-spin 1s linear infinite;
}

/* ============================================
   Error States
   ============================================ */

.bdow-error {
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.bdow-error-message {
    color: #856404;
    margin-bottom: 20px;
}

.bdow-retry-button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
    outline: none;
}

.bdow-retry-button:hover {
    background: #0056b3;
}

.bdow-retry-button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ============================================
   Content Container
   ============================================ */

.bdow-content {
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .bdow-container {
        padding: 10px;
    }
    
    .bdow-nav {
        gap: 4px;
    }
    
    .bdow-nav-button {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .bdow-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   API Content Wrapper Styles
   Scoped styles for content from bongdanet.mobi API
   ============================================ */

#bdow-api-content-wrapper {
    font-family: Arial, Helvetica, sans-serif;
}

#bdow-api-content-wrapper * {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

#bdow-api-content-wrapper *:before,
#bdow-api-content-wrapper *:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

#bdow-api-content-wrapper div,
#bdow-api-content-wrapper h2,
#bdow-api-content-wrapper p,
#bdow-api-content-wrapper strong {
    margin: 0;
    padding: 0;
    outline: 0;
    font-size: 14px;
    vertical-align: inherit;
    line-height: 18px;
    background: transparent;
    font-family: Arial, Helvetica, sans-serif;
}

#bdow-api-content-wrapper p {
    font-size: 14px;
    line-height: 18px;
    margin: 0px;
}

#bdow-api-content-wrapper :focus {
    outline: 0;
}

#bdow-api-content-wrapper .clear {
    clear: both;
}

#bdow-api-content-wrapper h2 {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.1;
    color: inherit;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    display: inline;
}

#bdow-api-content-wrapper .league-name {
    color: white;
    padding: 5px;
    float: left;
}

#bdow-api-content-wrapper .time-info {
    color: #606060;
    display: inline-block;
    width: 50px;
}

#bdow-api-content-wrapper .title-schedule-league {
    background-color: #00603a !important;
    display: block !important;
    padding: 5px 0 !important;
    overflow: hidden;
}

#bdow-api-content-wrapper .title-schedule-league a,
#bdow-api-content-wrapper .title-schedule-league h2,
#bdow-api-content-wrapper .title-schedule-league span {
    color: #fff !important;
}

#bdow-api-content-wrapper .league-links {
    float: right;
    padding-right: 8px;
    line-height: 31px;
}

#bdow-api-content-wrapper .league-links a {
    color: #fff !important;
    font-size: 11px;
    margin-left: 6px;
    text-decoration: none;
}

#bdow-api-content-wrapper .club-name {
    display: block;
    float: left;
    width: 200px;
}

#bdow-api-content-wrapper .club-name span {
    display: block;
    font-weight: bold;
    color: #666;
}

#bdow-api-content-wrapper .club-name strong {
    color: red !important;
    font-size: 12px;
}

#bdow-api-content-wrapper p.odds-data {
    display: block;
    text-align: right;
    clear: both;
    height: 16px;
    line-height: 16px;
    margin: 0;
    padding: 0;
}

#bdow-api-content-wrapper .odds-data .left-text {
    float: left;
    text-align: left;
    width: 50%;
    font-weight: bold;
    color: #666;
}

#bdow-api-content-wrapper .odds-data .left-text.highlight {
    color: #04903f !important;
    font-weight: bold;
}

#bdow-api-content-wrapper .odds-data .right-text {
    text-align: right;
    width: 50%;
    float: right;
    color: #666;
}

#bdow-api-content-wrapper .list-link-of-league .title-schedule-league {
    display: block;
    padding-left: 12px;
    overflow: hidden;
    height: 31px;
    line-height: 31px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item {
    display: block;
    min-height: 56px;
    height: auto;
    background-color: #c6d4f1;
    border-bottom: 1px solid #fff;
    overflow: hidden;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .time-info {
    display: inline-block;
    width: 40px;
    text-align: center;
    border-right: 1px solid #f2f2f2;
    vertical-align: top;
    padding-top: 4px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .time-info span {
    color: #EE6363;
    font-size: 11px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .club-name {
    display: inline-block;
    width: calc(100% - 340px);
    vertical-align: top;
    border-right: 1px solid #f2f2f2;
    min-height: 54px;
    height: auto;
    float: none;
    padding-top: 4px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .club-name span,
#bdow-api-content-wrapper .list-link-of-league .content-odds-item .club-name strong {
    display: block;
    height: 18px;
    line-height: 18px;
    overflow: hidden;
    width: 100%;
    font-size: 12px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .club-name span {
    font-weight: 500;
    color: #333;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .club-name strong {
    color: #333;
}

#bdow-api-content-wrapper .list-link-of-league .club-name span.hafttime {
    color: #159f3a;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content {
    border-right: 1px solid #f2f2f2;
    display: inline-block;
    min-height: 56px;
    height: auto;
    padding: 2px 5px 2px 0;
    vertical-align: top;
    width: 100px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content .odds-data {
    display: block;
    height: 18px;
    font-size: 12px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content .odds-data span {
    display: block;
    float: left;
    width: 50%;
    height: 18px;
    font-weight: bold;
    color: #444;
    font-size: 12px;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content .odds-data .highlight {
    font-weight: bold;
    color: #159f3a;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content .odds-data .right-text {
    text-align: right;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item.even {
    background-color: #e4e4e4;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content.europe-ratio {
    width: 70px;
    border-right: none;
    overflow: visible;
    vertical-align: top;
}

#bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content.europe-ratio .odds-data span {
    width: 100%;
    text-align: center;
    float: none;
}

/* Mobile responsive styles for API content */
@media only screen and (max-width: 480px) {
    #bdow-api-content-wrapper .time-info {
        font-size: 11px;
        width: 35px;
    }

    #bdow-api-content-wrapper .list-link-of-league .title-schedule-league {
        height: 31px;
        line-height: 22px;
    }

    #bdow-api-content-wrapper .list-link-of-league .content-odds-item .club-name {
        width: calc(100% - 250px);
    }

    #bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content {
        width: 65px;
    }

    #bdow-api-content-wrapper .list-link-of-league .content-odds-item .odds-content.europe-ratio {
        width: 50px;
    }
}
