/* Montana Lottery Shortcodes Styles */

.montana-lottery-container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 20px;
    font-family: Futura, sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 23px;
    color: rgb(35, 31, 32);
}

/* Filter Styles */
.montana-lottery-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.filter-group label {
    font-weight: 500;
    color: #333;
    text-align: center;
}

.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    min-width: 150px;
    width: auto;
}

.filter-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.montana-lottery-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: #6f42c1;
    color: white;
}

.btn-primary:hover {
    background: #5a32a3;
}

.btn-secondary {
    background: #6f42c1;
    color: white;
}

.btn-secondary:hover {
    background: #5a32a3;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.montana-lottery-filters button {
    background-color: #621244;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    text-align: center;
}

.montana-lottery-filters button:hover {
    background-color: #4a0e33;
}

/* Make both buttons the same size */
.montana-lottery-buttons button {
    min-width: 140px;
    height: 40px;
    box-sizing: border-box;
    text-align: center;
}

/* Star button styling */
#show-results {
    position: relative;
}

#show-results::after {
    content: "★";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 16px;
}

/* Hide the original star in the button text */
#show-results {
    padding-right: 35px;
}

/* Table Styles */
.montana-lottery-table-wrapper {
    overflow: auto;
    border-radius: 8px;
    position: relative;
}

.montana-lottery-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

/* Mobile responsive table styles */
@media (max-width: 768px) {
    .montana-lottery-container {
        overflow: visible;
        max-width: 100%;
        padding: 15px;
    }
    
    .montana-lottery-table-wrapper {
        overflow-x: scroll;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        position: relative;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .montana-lottery-table {
        min-width: 800px;
        width: 100%;
        margin: 0;
        border-collapse: separate;
        border-spacing: 0;
    }
    
    .montana-lottery-table thead th,
    .montana-lottery-table tbody td {
        padding: 8px 6px;
        font-size: 11px;
        white-space: nowrap;
        min-width: 80px;
    }
    
    /* Force horizontal scroll */
    .montana-lottery-table-wrapper::-webkit-scrollbar {
        height: 8px;
    }
    
    .montana-lottery-table-wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .montana-lottery-table-wrapper::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .montana-lottery-table-wrapper::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

.montana-lottery-table thead th {
    background: #dc3545;
    color: white;
    font-weight: 700;
    padding: 12px 15px;
    text-align: center;
    font-size: 14px;
    position: relative;
    font-family: Futura, sans-serif;
}

.montana-lottery-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.montana-lottery-table thead th.sortable::after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.7;
}

.montana-lottery-table thead th.sortable.asc::after {
    content: '▲';
}

.montana-lottery-table tbody tr {
    border-bottom: 1px solid #f8f9fa;
}

.montana-lottery-table tbody > tr:nth-child(odd) > td,
.montana-lottery-table tbody > tr:nth-child(odd) > th {
    background-color: white !important;
}

.montana-lottery-table tbody > tr:nth-child(even) > td,
.montana-lottery-table tbody > tr:nth-child(even) > th {
    background-color: #F3F3F3 !important;
}

.montana-lottery-table tbody td {
    padding: 12px 15px;
    font-size: 14px;
    color: rgb(35, 31, 32);
    text-align: center;
    font-family: Futura, sans-serif;
    font-weight: 500;
}

.montana-lottery-table tbody td.numbers {
    font-family: Futura, sans-serif;
    font-weight: 500;
    color: rgb(35, 31, 32);
}

.montana-lottery-table tbody td.currency {
    font-weight: 500;
    color: rgb(35, 31, 32);
}

/* Pagination Styles */
.montana-lottery-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    background: white;
    color: #495057;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.pagination-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background: #495057;
    color: white;
    border-color: #495057;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.montana-lottery-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.montana-lottery-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Empty State */
.montana-lottery-empty {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .montana-lottery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .montana-lottery-buttons {
        margin-left: 0;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .montana-lottery-buttons button {
        width: 100%;
        max-width: 200px;
        margin: 0;
    }
    
    .montana-lottery-table thead th,
    .montana-lottery-table tbody td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .montana-lottery-pagination {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
    
    /* Hide Previous and Next buttons on mobile - Elementor compatible */
    .pagination-btn[data-page]:not([data-page="1"]):not([data-page="2"]):not([data-page="3"]):not([data-page="4"]):not([data-page="5"]):not([data-page="6"]):not([data-page="7"]):not([data-page="8"]):not([data-page="9"]):not([data-page="10"]) {
        display: none !important;
    }
    
    /* Elementor responsive utilities */
    .elementor-hidden-mobile {
        display: none !important;
    }
    
    /* Ensure Elementor containers don't interfere */
    .elementor-widget-container .montana-lottery-container {
        overflow: visible;
        max-width: 100%;
    }
}

/* Tablet responsive styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .montana-lottery-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .montana-lottery-table {
        min-width: 800px;
    }
    
    .montana-lottery-table thead th,
    .montana-lottery-table tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .montana-lottery-table {
        min-width: 500px;
        font-size: 10px;
        width: 100%;
    }
    
    .montana-lottery-table thead th,
    .montana-lottery-table tbody td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .montana-lottery-container {
        padding: 15px;
        margin: 10px auto;
        overflow-x: visible;
        max-width: 100%;
    }
    
    .montana-lottery-filters {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .montana-lottery-buttons {
        gap: 8px;
    }
    
    .montana-lottery-buttons button {
        max-width: 180px;
        height: 44px; /* Better touch target */
        font-size: 13px;
    }
    
    .montana-lottery-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        position: relative;
        width: 100%;
        max-width: 100%;
    }
    
    /* Mobile pagination optimization - Elementor compatible */
    .montana-lottery-pagination {
        padding: 10px 15px;
    }
    
    .pagination-info {
        padding-bottom: 10px;
        margin-bottom: 10px;
    }
    
    .pagination-controls {
        gap: 3px;
    }
    
    .pagination-btn {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 32px;
    }
    
    /* Elementor mobile optimizations */
    .elementor-widget-container {
        padding: 0;
        margin: 0;
    }
    
    .elementor-section {
        padding: 0;
        margin: 0;
    }
    
    /* Ensure Elementor doesn't add unwanted margins */
    .elementor-widget:not(:last-child) {
        margin-bottom: 0;
    }
}

/* Specific styles for winning numbers table */
.winning-numbers-table .numbers {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #495057;
}

/* Specific styles for winning details table */
.winning-details-table .match-type {
    color: rgb(35, 31, 32);
    font-size: 12px;
    font-weight: 500;
}

.winning-details-table .prize-amount {
    font-weight: 500;
    color: rgb(35, 31, 32);
}

.winning-details-table .winners-count {
    color: rgb(35, 31, 32);
    font-size: 13px;
}
