/* General table styles */
.table-container {
    overflow-x: auto;
    margin: 0 auto;
    position: relative; /* Ensure the container can hold absolutely positioned elements */
    width: 80%;
    margin-top: 20px;
}

.widget-container {
    display: flex;
    gap: 20px; /* Отступ между виджетом и рекламой */
    margin: 20px;
}

.widget-content {
    flex: 1; /* Занимает основное пространство */
    width: 100%; /* Адаптивность */
}

.custom-table {
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
    border: 1px solid #ddd;
    margin: 0 auto;
    width: 100%;
}

.custom-table th,
.custom-table td {
    border: 1px solid #ddd;
    padding: 5px;
}

.custom-table th {
    background-color: #f4f4f4;
    color: #333;
    font-weight: bold;
}

.custom-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.custom-table tr:hover {
    background-color: #f1f1f1;
}

/* Table header styles */
.table-header {
    background-color: #05831a;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    padding: 10px 0;
    margin: 0 auto;
}

/* Стили для логотипа команды */
.team-logo {
    display: inline-block; /* Делаем блок строчным */
    vertical-align: middle; /* Выравниваем по центру относительно текста */
    margin-right: 8px; /* Отступ справа от логотипа */
}

/* Стили для названия команды */
.team-name {
    display: inline-block; /* Делаем блок строчным */
    vertical-align: middle; /* Выравниваем по центру относительно логотипа */
    font-weight: bold; /* Опционально: делаем название команды жирным */
}

/* Shortened table styles */
.custom-table.shortened tr:nth-child(n+7) {
    display: none; /* Hide rows beyond the first six */
}

/* Overlay for the 6th row */
.custom-table.shortened tr:nth-child(6):after {
    content: '';
    position: absolute;
    top: 80%;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1; /* Ensure the overlay is above the row content */
    margin: 0 auto;
}

/* Read More link on the 6th row */
.custom-table.shortened tr:nth-child(6) .read-more {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: black;
    font-weight: bold;
    text-decoration: none;
    z-index: 2; /* Ensure the link is above the overlay */
}

.centered-date {
    text-align: center;
    width: 100%; /* Занимает всю доступную ширину */
    margin: 0 auto; /* Дополнительное центрирование (если нужно) */
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .widget-content {
        width: 100%; /* Адаптивность */
    }

    .table-container {
        margin: 20px 0;
        overflow-x: auto;
        margin: 0 auto;
        position: relative; /* Ensure the container can hold absolutely positioned elements */
        width: 100%;
    }

    .custom-table.shortened {
        font-size: 12px;
        width: 100%; /* Занимает всю доступную ширину */
    }

    .custom-table.shortened th,
    .custom-table.shortened td {
        padding: 4px; /* Уменьшаем отступы */
    }

    /* Скрываем столбцы после четвертого на мобильных устройствах */
    .custom-table.shortened th:nth-child(n+5),
    .custom-table.shortened td:nth-child(n+5) {
        display: none;
    }

    .custom-table th:nth-child(n+6),
    .custom-table td:nth-child(n+6) {
        display: none;
    }
}

@media (max-width: 1200px) {
    /* Уменьшаем размер шрифта и ячеек для маленьких экранов */
    .custom-table.shortened {
        font-size: 12px;
        width: 100%; /* Занимает всю доступную ширину */
    }

    .custom-table th,
    .custom-table td {
        padding: 4px; /* Уменьшаем отступы */
    }

    /* Скрываем столбцы после четвертого на мобильных устройствах */
    .custom-table.shortened th:nth-child(n+6),
    .custom-table.shortened td:nth-child(n+6) {
        display: none;
    }
}

/* ============================================
   LOTTERY WIDGETS STYLES
   ============================================ */

.lottery-results-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Desktop: Add side margins for future banners */
@media (min-width: 1024px) {
    .lottery-results-container {
        max-width: 900px;
        margin: 20px auto;
        padding: 30px 40px;
    }
}

.lottery-header {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.latest-draw {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.lottery-numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.lottery-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a9853 0%, #3d8044 100%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.lottery-ball:hover {
    transform: scale(1.1);
}

.draw-date {
    color: #666;
    font-size: 16px;
    margin-top: 20px;
}

.previous-draws {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.previous-draws h3 {
    margin-bottom: 20px;
    color: #333;
}

.draws-table {
    width: 100%;
    border-collapse: collapse;
}

.draws-table th,
.draws-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.draws-table th {
    background: #f5f5f5;
    font-weight: bold;
    color: #333;
}

.numbers-cell {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.small-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a9853 0%, #3d8044 100%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.source-link {
    text-align: center;
    margin-top: 20px;
    color: #999;
}

.source-link a {
    color: #667eea;
    text-decoration: none;
}

.source-link a:hover {
    text-decoration: underline;
}

/* Lottery widgets mobile styles */
@media (max-width: 768px) {
    .lottery-results-container {
        padding: 15px 10px;
        margin: 10px 5px;
        border-radius: 8px;
    }

    .lottery-header {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .latest-draw {
        padding: 15px;
    }

    .latest-draw h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .lottery-numbers {
        gap: 8px;
        margin: 15px 0;
    }

    .lottery-ball {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .draw-date {
        font-size: 14px;
        margin-top: 15px;
    }

    .previous-draws {
        padding: 15px;
        overflow-x: auto;
    }

    .previous-draws h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .draws-table {
        font-size: 12px;
        min-width: 100%;
    }

    .draws-table th,
    .draws-table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .draws-table th:first-child,
    .draws-table td:first-child {
        width: 50px;
        text-align: center;
    }

    .draws-table th:nth-child(2),
    .draws-table td:nth-child(2) {
        width: 80px;
        font-size: 11px;
    }

    .numbers-cell {
        justify-content: flex-start;
        gap: 3px;
        flex-wrap: wrap;
    }

    .small-ball {
        width: 24px;
        height: 24px;
        font-size: 10px;
        margin: 2px;
    }
}

/* Lottery Card Styles for Homepage (loto-online.ro style) */
.lottery-card-loto-online {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.lottery-card-loto-online:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Image section */
.lottery-card-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.lottery-card-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 450 / 317;
    object-fit: cover;
}

/* Content section */
.lottery-card-content {
    padding: 20px;
    text-align: center;
}

.lottery-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.lottery-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.lottery-card-title a:hover {
    color: #4a9853;
}

/* Date */
.lottery-card-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

/* Numbers section */
.lottery-card-numbers {
    min-height: 190px;
    display: flex;
    align-items: start;
    justify-content: center;
    margin-bottom: 15px;
}

.lottery-numbers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 -10px;
}

/* White balls with gray border (loto-online.ro style) */
.lottery-ball-simple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 1px solid #d1d5db;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
    margin-bottom: 10px;
}

/* Button */
.lottery-card-button a {
    display: inline-block;
    background: #4a9853;
    color: white;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s;
}

.lottery-card-button a:hover {
    background: #3d8044;
    text-decoration: none;
    color: white;
}

@media (max-width: 768px) {
    .lottery-card-loto-online {
        margin-bottom: 20px;
    }

    .lottery-card-numbers {
        min-height: 152px;
    }

    .lottery-ball-simple {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
}

/* Responsive for sm screens */
@media (min-width: 640px) {
    .lottery-card-numbers {
        min-height: 152px;
    }
}

/* Sticky Navigation for Lottery Article Page */
.lottery-nav {
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.lottery-nav-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.lottery-nav a {
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.lottery-nav a:hover,
.lottery-nav a.active {
    color: #4a9853;
    background: #f0f9f4;
}

/* Lottery Article Page Sections */
.lottery-results-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.lottery-results-page section {
    margin-bottom: 50px;
    scroll-margin-top: 80px;
}

.lottery-results-page h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #4a9853;
}

.lottery-results-page h3 {
    font-size: 20px;
    color: #555;
    margin-bottom: 15px;
}

/* Informatii section */
.lottery-info {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    line-height: 1.8;
}

.lottery-info h3 {
    color: #4a9853;
    margin-top: 25px;
    margin-bottom: 15px;
}

.lottery-info p {
    color: #555;
    margin-bottom: 15px;
}

.lottery-info ul {
    margin-left: 20px;
    color: #555;
}

.lottery-info ul li {
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .lottery-nav-inner {
        gap: 15px;
    }

    .lottery-nav a {
        font-size: 13px;
        padding: 6px 12px;
    }

    .lottery-results-page {
        padding: 15px;
    }

    .lottery-results-page h2 {
        font-size: 24px;
    }

    .lottery-info {
        padding: 20px;
    }
}