/* CSS สำหรับ ruts Games Plugin */
.ruts-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Sarabun', 'Prompt', sans-serif;
}

/* --------------------------------------
 * Medals Table
 * -------------------------------------- */
.ruts-medals-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.ruts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: center;
    min-width: 600px; /* ป้องกันไม่ให้ตารางบีบเกินไปบนมือถือ */
}

.ruts-table thead th {
    background: var(--ruts-primary, #003B5C); /* สีน้ำเงินเข้ม */
    color: #fff;
    padding: 15px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
}

.ruts-table thead th:first-child {
    border-top-left-radius: 12px;
}
.ruts-table thead th:last-child {
    border-top-right-radius: 12px;
}

.ruts-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #444;
    vertical-align: middle;
}

.ruts-table tbody tr:last-child td {
    border-bottom: none;
}

.ruts-table tbody tr:hover td {
    background-color: #f9fbfd;
}

.ruts-table .col-team {
    text-align: left;
    font-weight: 500;
    font-size: 1.05rem;
}

/* เหรียญรางวัลและสีพื้นหลังอันดับ */
.medal-icon {
    font-size: 1.2rem;
}

.rank-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: #eee;
    color: #666;
    font-weight: 700;
}

tr.rank-top .rank-number {
    color: #fff;
}
tr.rank-1 .rank-number {
    background: #FFD700; /* Gold */
}
tr.rank-2 .rank-number {
    background: #C0C0C0; /* Silver */
}
tr.rank-3 .rank-number {
    background: #CD7F32; /* Bronze */
}

.font-weight-bold {
    font-weight: bold;
    color: #000 !important;
}

.sr-only {
    display: none;
}

/* --------------------------------------
 * Programs Cards
 * -------------------------------------- */
.ruts-programs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 1rem;
}

.ruts-program-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #f0f0f0;
}

.ruts-program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.program-header {
    background: linear-gradient(135deg, var(--ruts-secondary, #005A8C), var(--ruts-primary, #003B5C));
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.program-sport {
    font-weight: 600;
}

.program-datetime {
    font-size: 0.85rem;
    opacity: 0.9;
}

.program-body {
    padding: 20px 15px;
}

.program-matchup {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.team {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.match-vs {
    background: #f0f0f0;
    color: #888;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.program-footer {
    background: #f9f9f9;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    border-top: 1px solid #eee;
}

.ruts-error {
    background: #ffebe9;
    color: #d73a49;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ffdce0;
    text-align: center;
    margin: 20px 0;
}

/* --------------------------------------
 * Responsive
 * -------------------------------------- */
@media (max-width: 768px) {
    .ruts-table thead th {
        font-size: 0.9rem;
        padding: 10px;
    }
    .ruts-table tbody td {
        font-size: 0.95rem;
        padding: 10px;
    }
    .ruts-table .col-team {
        font-size: 0.95rem;
    }
    .team {
        font-size: 1rem;
    }
}

/* =========================================
   Date Navigator
   ========================================= */
.ruts-date-navigator {
    margin-bottom: 25px;
    text-align: center;
}

.date-nav-title {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 12px;
}

.date-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ruts-btn-date {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    border-radius: 20px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ruts-btn-date:hover {
    background: #e0e0e0;
    color: var(--ruts-primary);
    transform: translateY(-2px);
}

.ruts-btn-date.active {
    background: var(--ruts-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* --------------------------------------
 * Search Box
 * -------------------------------------- */
.ruts-search-container {
    margin-bottom: 20px;
}
.ruts-search-box {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}
.ruts-search-box:focus {
    border-color: var(--ruts-primary);
}

/* --------------------------------------
 * Skeleton Loading
 * -------------------------------------- */
.ruts-skeleton-loading {
    position: relative;
    overflow: hidden;
}
.ruts-skeleton-loading::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}
.ruts-skeleton-loading::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ruts-primary);
    border-radius: 50%;
    animation: ruts-spin 1s linear infinite;
    z-index: 11;
}
@keyframes ruts-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --------------------------------------
 * Highlights Slider
 * -------------------------------------- */
.ruts-highlights-wrapper {
    margin-bottom: 30px;
}
.ruts-highlights-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--ruts-primary);
}
.ruts-highlights-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.ruts-highlights-slider::-webkit-scrollbar {
    height: 6px;
}
.ruts-highlights-slider::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 10px;
}
.ruts-highlights-slider::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 10px;
}
.ruts-highlight-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    background: linear-gradient(135deg, var(--ruts-primary), var(--ruts-secondary));
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.hl-sport { font-weight: bold; font-size: 1.1rem; margin-bottom: 5px; }
.hl-time { font-size: 0.85rem; opacity: 0.9; margin-bottom: 10px; }
.hl-matchup { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.1); padding: 8px; border-radius: 8px;}
.hl-team { font-weight: 600; font-size: 0.95rem; text-align: center; flex: 1; }
.hl-vs { font-size: 0.8rem; background: #fff; color: var(--ruts-primary); padding: 2px 6px; border-radius: 10px; margin: 0 5px; }

/* --------------------------------------
 * Top Performers Widget
 * -------------------------------------- */
.ruts-widget-wrapper {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.ruts-widget-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--ruts-primary);
    display: inline-block;
    padding-bottom: 5px;
}
.ruts-widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ruts-widget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border: 1px solid #ffdce0;
    text-align: center;
    margin: 20px 0;
}

/* --------------------------------------
 * Responsive
 * -------------------------------------- */
@media (max-width: 768px) {
    .ruts-table thead th {
        font-size: 0.9rem;
        padding: 10px;
    }
    .ruts-table tbody td {
        font-size: 0.95rem;
        padding: 10px;
    }
    .ruts-table .col-team {
        font-size: 0.95rem;
    }
    .team {
        font-size: 1rem;
    }
}

/* =========================================
   Date Navigator
   ========================================= */
.ruts-date-navigator {
    margin-bottom: 25px;
    text-align: center;
}

.date-nav-title {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 12px;
}

.date-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ruts-btn-date {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    border-radius: 20px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ruts-btn-date:hover {
    background: #e0e0e0;
    color: var(--ruts-primary);
    transform: translateY(-2px);
}

.ruts-btn-date.active {
    background: var(--ruts-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* --------------------------------------
 * Search Box
 * -------------------------------------- */
.ruts-search-container {
    margin-bottom: 20px;
}
.ruts-search-box {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}
.ruts-search-box:focus {
    border-color: var(--ruts-primary);
}

/* --------------------------------------
 * Skeleton Loading
 * -------------------------------------- */
.ruts-skeleton-loading {
    position: relative;
    overflow: hidden;
}
.ruts-skeleton-loading::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}
.ruts-skeleton-loading::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ruts-primary);
    border-radius: 50%;
    animation: ruts-spin 1s linear infinite;
    z-index: 11;
}
@keyframes ruts-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* --------------------------------------
 * Highlights Slider
 * -------------------------------------- */
.ruts-highlights-wrapper {
    margin-bottom: 30px;
}
.ruts-highlights-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--ruts-primary);
}
.ruts-highlights-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.ruts-highlights-slider::-webkit-scrollbar {
    height: 6px;
}
.ruts-highlights-slider::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 10px;
}
.ruts-highlights-slider::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 10px;
}
.ruts-highlight-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    background: linear-gradient(135deg, var(--ruts-primary), var(--ruts-secondary));
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.hl-sport { font-weight: bold; font-size: 1.1rem; margin-bottom: 5px; }
.hl-time { font-size: 0.85rem; opacity: 0.9; margin-bottom: 10px; }
.hl-matchup { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.1); padding: 8px; border-radius: 8px;}
.hl-team { font-weight: 600; font-size: 0.95rem; text-align: center; flex: 1; }
.hl-vs { font-size: 0.8rem; background: #fff; color: var(--ruts-primary); padding: 2px 6px; border-radius: 10px; margin: 0 5px; }

/* --------------------------------------
 * Top Performers Widget
 * -------------------------------------- */
.ruts-widget-wrapper {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.ruts-widget-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--ruts-primary);
    display: inline-block;
    padding-bottom: 5px;
}
.ruts-widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ruts-widget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.ruts-widget-item:last-child {
    border-bottom: none;
}
.w-rank { font-weight: bold; color: #888; width: 25px; }
.w-team { flex: 1; font-weight: 600; font-size: 0.95rem; }
.w-gold { font-weight: bold; color: #D4AF37; }

/* --------------------------------------
 * Dashboard Grid
 * -------------------------------------- */
.ruts-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 25px;
    padding: 10px;
}
.ruts-sport-card {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 20px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #f0f0f0;
}
.ruts-sport-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.ruts-sport-mascot {
    margin-bottom: 15px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.ruts-sport-mascot img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ruts-sport-name {
    font-size: 1.15rem;
    font-weight: bold;
    text-align: center;
    color: var(--ruts-primary);
}
