/* Стили для фронтенда Jackpots Plugin */

/* Общие стили для контейнеров */
.jackpots-providers,
.jackpots-games,
.jackpots-top {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.jackpots-providers h3,
.jackpots-games h3,
.jackpots-top h3 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    font-size: 24px;
}

/* Сетки для карточек */
.jackpots-providers-grid,
.jackpots-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.jackpots-top-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Карточки провайдеров */
.jackpots-provider-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.jackpots-provider-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.provider-logo {
    text-align: center;
    margin-bottom: 15px;
}

.provider-logo img {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 4px;
}

.provider-info h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.provider-info p {
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.games-count {
    display: inline-block;

    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}

.provider-website {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.provider-website:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Карточки игр */
.jackpots-game-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.jackpots-game-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.game-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.jackpots-game-item:hover .game-image img {
    transform: scale(1.05);
}

.game-info {
    padding: 20px;
}

.game-info h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.game-provider {
    color: #0073aa;
    font-weight: 600;
    margin-bottom: 10px;
}

.game-jackpot {
    color: white;

    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: left;
    font-weight: bold;
}

.jackpot-amount {
    background-color: #2a2b32;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    top: 5px;
    left: -10px;
}

.jackpot-amount strong {
    color: #ffb300;
    font-size: 16px;
    font-weight: 700;
}

.game-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.game-demo {
    display: inline-block;
    background: #ffc107;
    color: #333;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.game-demo:hover {
    background: #e0a800;
    color: #333;
    text-decoration: none;
}

/* Топ джекпотов */
.jackpots-top-item {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.jackpots-top-item:hover {
    transform: translateX(5px);
}

.top-position {
    background: #0073aa;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 15px;
    flex-shrink: 0;
}

.jackpots-top-item:nth-child(1) .top-position {
    background: #ffd700;
    color: #333;
}

.jackpots-top-item:nth-child(2) .top-position {
    background: #c0c0c0;
    color: #333;
}

.jackpots-top-item:nth-child(3) .top-position {
    background: #cd7f32;
    color: white;
}

/* Ошибки */
.jackpots-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {

    .jackpots-providers-grid,
    .jackpots-games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .jackpots-top-item {
        flex-direction: column;
        text-align: center;
    }

    .top-position {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .game-image {
        height: 150px;
    }

    .jackpots-providers h3,
    .jackpots-games h3,
    .jackpots-top h3 {
        font-size: 20px;
    }

    .jackpots-games-table .game-name {
        text-align: left;
    }

    .jackpots-games-table td.game-jackpot {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .jackpots-games-table td:last-child {
        border-bottom: 0;
    }

    /* Fix for History Modal on Mobile */
    #history-header {
        padding-right: 40px;
        /* Space for the close button */
    }

    #history-content {
        height: 50vh;
        max-height: 300px;
    }

    .jackpots-games-table .game-number {
        width: auto;
    }

    .jackpots-games-table .game-provider,
    .jackpots-games-table .game-name,
    .jackpots-games-table td.game-jackpot {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .jackpots-games-table td.game-actions {
        display: flex;
        justify-content: flex-end;
    }

    /* Reset jackpot amount styles for mobile to avoid inheriting desktop adjustments */
    .jackpot-amount {
        position: static;
        background-color: transparent;
        padding: 0;
        width: auto;
        border-radius: 0;
    }
}

@media (max-width: 480px) {

    .jackpots-provider-item,
    .jackpots-game-item {
        padding: 15px;
    }

    .game-info {
        padding: 15px;
    }

    .provider-logo img {
        max-width: 100px;
        max-height: 60px;
    }

    .jackpots-games-table {
        font-size: 12px;
    }

    .jackpots-games-table .game-provider,
    .jackpots-games-table .game-name,
    .jackpots-games-table td.game-jackpot {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .jackpot-amount {
        text-align: right;
    }

    .jackpot-amount {
        font-size: 14px;
    }
}

/* Стили для таблицы игр */
.jackpots-games-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.jackpots-games-container h2 {
    color: #ffb300;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.jackpots-games-container h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #ffb300;
    border-radius: 2px;
}

.jackpots-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 16px #0008;
    background: #23242a;
    border: none;
}

.jackpots-games-table {
    width: 100%;
    border-collapse: collapse;
    background: #23242a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px #0008;
    font-size: 14px;
}

.jackpots-games-table th {
    background: #292b32;
    color: #ffb300;
    font-weight: 600;
    font-size: 1.1em;
    padding: 12px 18px;
    text-align: left;
    border: none;
}

.jackpots-games-table td {
    padding: 12px 18px;
    text-align: left;
    font-size: 1em;
    border: none;
    vertical-align: middle;
}

.jackpots-games-table tr:nth-child(even) {
    background: #202127;
}

.jackpots-games-table tr:nth-child(odd) {
    background: #23242a;
}

.jackpots-games-table tr:hover {
    background: #2a2b32;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-number {
    font-weight: 600;
    color: #ffb300;
    text-align: center;
    font-size: 16px;
    min-width: 50px;
}

.game-provider strong {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.game-name strong {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

/* Ваш стиль для td.game-jackpot, немного измененный */
.game-jackpot {
    font-weight: bold;
}

/* Стили для td.game-jackpot, как на скриншоте */
.jackpots-games-table td.game-jackpot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.no-jackpot {
    color: #888;
    font-style: italic;
    text-align: center;
    display: block;
    width: 100%;
}

.action-btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    background: #292b32;
    color: #ffb300;
    border: 1px solid #444;
}

.history-btn:hover {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.stats-btn:hover {
    background-color: #1e88e5;
    border-color: #1e88e5;
}

/* === MODAL STYLES === */
.jackpots-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
    padding: 15px;
}

.jackpots-modal.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content,
.jackpots-modal-content {
    background-color: #2c2c2c;
    margin: 0;
    padding: 30px;
    border: 1px solid #444;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    color: #f0f0f0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    -webkit-animation: slideIn 0.3s ease;
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

.close,
.jackpots-close {
    color: red;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s;
}

.close:hover,
.close:focus,
.jackpots-close:hover,
.jackpots-close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* === STATS MODAL CONTENT === */
.stats-container {
    background-color: #f5f2ed;
    color: #4a4a4a;
    padding: 20px;
    border-radius: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stats-header {
    font-size: 16px;
    font-weight: bold;
    color: #c0392b;
    padding-bottom: 8px;
    border-bottom: 2px solid #e74c3c;
    margin-bottom: 15px;
}

.stats-header.recent-wins {
    margin-top: 25px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #e0dccc;
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-row span:first-child {
    font-weight: 600;
}

.stats-row span:last-child {
    font-weight: 500;
}


/* === HISTORY MODAL CONTENT === */
#history-header {
    text-align: center;
    margin-bottom: 20px;
}

#history-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 5px 0;
}

#history-average {
    font-size: 16px;
    color: #ccc;
}

#history-content {
    min-height: 200px;
    height: 45vh;
    max-height: 280px;
}

/* Адаптивность для таблицы */
@media (max-width: 768px) {
    .jackpots-games-table {
        display: block;
    }

    .jackpots-games-table thead {
        display: none;
    }

    .jackpots-games-table tbody {
        display: block;
    }

    .jackpots-games-table tr {
        display: block;
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #555;
        background: #2a2b2f;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }

    .jackpots-games-table td {
        display: block;
        text-align: right;
        padding: 12px 15px 12px 50%;
        position: relative;
        border-bottom: 1px solid #444;
    }

    .jackpots-games-table .game-number {
        width: auto;
    }

    .jackpots-games-table td.game-jackpot {
        display: flex;
        justify-content: flex-end;
    }

    .jackpots-games-table td:last-child {
        border-bottom: 0;
    }

    .jackpots-games-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        text-align: left;
        font-weight: bold;
        color: #ffb300;
        top: 50%;
        transform: translateY(-50%);
    }

    .jackpots-games-table td.game-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
    }

    .jackpots-games-table td.game-actions .action-btn {
        padding: 8px 10px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .jackpots-games-table {
        font-size: 12px;
    }

    .jackpots-games-table .game-provider,
    .jackpots-games-table .game-name,
    .jackpots-games-table td.game-jackpot {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .jackpot-amount {
        text-align: right;
    }

    .jackpot-amount {
        font-size: 14px;
    }
}

/* Specific styles for stats modal to match the screenshot */
#stats-modal .jackpots-modal-content {
    background-color: #f5f2ed;
}

#stats-modal .stats-container {
    background-color: transparent;
    /* Container is now the modal bg */
    color: #4a4a4a;
    padding: 0;
    border-radius: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#stats-modal .stats-header {
    font-size: 16px;
    font-weight: bold;
    color: #c0392b;
    padding-bottom: 8px;
    border-bottom: 2px solid #e74c3c;
    margin-bottom: 15px;
}

#stats-modal .stats-header.recent-wins {
    margin-top: 25px;
}

#stats-modal .stats-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #e0dccc;
}

#stats-modal .stats-row:last-child {
    border-bottom: none;
}

#stats-modal .stats-row span:first-child {
    font-weight: 600;
}

#stats-modal .stats-row span:last-child {
    font-weight: 500;
}