/**
 * Spotlight page and spotlight table (row) styles
 * Used by: Spotlight.php, AdminPanel.php (Spotlight tab)
 * Edit this file for consistent spotlight table appearance across pages.
 */

/* ========== Spotlight header & section ========== */
.spotlight-header {
    text-align: center;
    margin-bottom: 30px;
}

.spotlight-header h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2em;
}

.spotlight-info {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 10px;
}

/* Combined banner: group icon + name/description + timer */
.spotlight-section-title {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background-image: url('../img/img_banner_01.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.5);
    font-size: 1.1em;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
}

.spotlight-section-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.06) 50%, rgba(0, 0, 0, 0.22) 100%);
    pointer-events: none;
}

.spotlight-section-title > * {
    position: relative;
    z-index: 1;
}

.spotlight-section-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.spotlight-section-text {
    flex: 1;
    min-width: 200px;
}

.spotlight-section-text .spotlight-group-name {
    color: white;
    font-size: 1.25em;
    margin-bottom: 4px;
}

.spotlight-section-text .spotlight-group-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.spotlight-section-timer {
    flex-shrink: 0;
    text-align: right;
    color: white;
}

.spotlight-section-timer .refresh-info-label {
    font-size: 0.85em;
    opacity: 0.95;
    color: white;
}

.spotlight-section-timer .refresh-info-time {
    font-size: 1.25em;
    margin: 4px 0 2px 0;
    color: #667eea;
}

.spotlight-section-timer .refresh-info-time .refresh-countdown,
.spotlight-section-timer .refresh-info-time .refresh-overdue {
    color: #667eea;
}

.spotlight-section-timer .refresh-info-time .refresh-countdown {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #667eea;
    background-clip: unset;
}

.spotlight-section-timer .refresh-info-date {
    font-size: 0.8em;
    opacity: 0.9;
    color: white;
}

/* ========== Spotlight level list / table (row styles) ========== */
.level-list {
    margin-top: 15px;
}

.level-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.level-list-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.level-list-table th {
    padding: 12px 16px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.level-list-table th:nth-child(1) {
    text-align: left;
}

.level-list-table th:nth-child(2),
.level-list-table th:nth-child(3) {
    text-align: center;
}

.level-list-table th:first-child {
    border-radius: 8px 0 0 0;
}

.level-list-table th:last-child {
    border-radius: 0 8px 0 0;
}

.level-list-table td {
    padding: 22px 16px;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.level-list-table td:nth-child(1) {
    text-align: left;
}

.level-list-table td:nth-child(2),
.level-list-table td:nth-child(3) {
    text-align: center;
}

.level-name-text {
    transition: color 0.3s ease;
}

.level-list-table tbody tr {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    /* Row background image (set via inline --bg-image on tr) */
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.level-list-table tbody tr::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    opacity: 0.65;
    z-index: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.level-list-table tbody tr:hover {
    border-left-color: #667eea;
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.level-list-table tbody tr:hover::after {
    opacity: 0.48;
}

.level-list-table tbody tr td {
    position: relative;
    z-index: 2;
}

.level-list-table tbody tr:last-child td {
    border-bottom: none;
}

.level-name-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    z-index: 3;
}

.level-name-link:hover {
    color: #764ba2;
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
    transform: translateX(4px);
}

.level-name-cell {
    display: flex;
    align-items: center;
}

.level-gamemode {
    color: var(--text-secondary);
    text-align: center;
}

.level-difficulty {
    color: var(--text-secondary);
    text-align: center;
}

.level-plays {
    color: var(--text-secondary);
    text-align: center;
}

.no-levels {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ========== Spotlight group info (optional block) ========== */
.spotlight-group-info {
    margin-top: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    text-align: left;
}

.spotlight-group-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 6px;
}

.spotlight-group-description {
    font-size: 0.95em;
    color: var(--text-secondary);
    line-height: 1.45;
}

[data-theme="dark"] .spotlight-group-name {
    color: #8a9eff;
}

/* ========== Refresh button & card (Spotlight page) ========== */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.refresh-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 18px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.refresh-info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: spotlight-shimmer 3s infinite;
}

@keyframes spotlight-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.refresh-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
}

[data-theme="dark"] .refresh-info-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.4);
}

.refresh-info-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.refresh-info-icon svg {
    width: 24px;
    height: 24px;
    animation: spotlight-pulse 2s ease-in-out infinite;
}

@keyframes spotlight-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.refresh-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.refresh-info-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.refresh-info-time {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

.refresh-countdown {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.refresh-overdue {
    color: #ff6b6b;
    animation: spotlight-blink 1s ease-in-out infinite;
}

@keyframes spotlight-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.refresh-info-date {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 500;
}
