/* ========================================
   WP Race Results - Modern Luxury Modal Styles
   ======================================== */

/* Modal Base Styles */
.wprr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.wprr-modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wprr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wprr-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 16px;
    /* Luxury shadow: soft, diffused, multi-layered */
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 10px 20px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wprrModalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes wprrModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.wprr-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.wprr-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

/* Clean Static Close Icon */
.wprr-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 0.9;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
    padding: 0;
    width: auto;
    height: auto;
}

.wprr-modal-close:hover {
    color: #333;
}

.wprr-modal-close:active {
    color: #000;
}

/* Modal Body */
.wprr-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

/* Custom Scrollbar (Webkit) */
.wprr-modal-body::-webkit-scrollbar {
    width: 8px;
}

.wprr-modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.wprr-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.wprr-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading State */
#wprr-modal-loader {
    text-align: center;
    padding: 40px;
    font-style: italic;
    color: #666;
}

/* Table Styles - Luxury Edition */
.wprr-modal-scroll-area {
    width: 100%;
}

.wprr-modal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    overflow: hidden;
}

.wprr-modal-table th,
.wprr-modal-table td {
    padding: 14px 16px;
    text-align: left;
}

.wprr-modal-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e8eaed;
}

.wprr-modal-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.wprr-modal-table tbody tr:hover {
    background-color: #fafafa;
}

/* Ensure last row has border (enclosed look) */
.wprr-modal-table tbody tr:last-child {
    border-bottom: none;
}

.wprr-modal-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .wprr-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .wprr-modal-header {
        padding: 20px;
    }

    .wprr-modal-body {
        padding: 20px;
    }

    .wprr-modal-table th,
    .wprr-modal-table td {
        padding: 12px;
        font-size: 0.9rem;
    }

    .wprr-modal-table th {
        font-size: 11px;
    }

    .wprr-modal-close {
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
    }
}

/* Tablet Breakpoint */
@media (max-width: 768px) and (min-width: 601px) {
    .wprr-modal-content {
        max-width: 95%;
    }
}