/* Contest List View Styles - Card-based Rows */

/* View Toggle Buttons */
.view-toggle-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.view-toggle-btn:hover {
    border-color: #fbbf24;
    color: #fbbf24;
    background: #fffbeb;
}

.view-toggle-btn.active {
    border-color: #fbbf24;
    background: #fbbf24;
    color: #ffffff;
}

.view-toggle-btn.active:hover {
    background: #f59e0b;
    border-color: #f59e0b;
}

/* Ensure filter-controls can accommodate toggle button */
.filter-controls {
    display: flex !important;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-controls .filter-form {
    flex: 1;
    min-width: 0;
}

.contests-list-container {
    width: 100%;
    margin-bottom: 40px;
}

.contests-grid-container {
    width: 100%;
    margin-bottom: 40px;
}

.contests-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header Row */
.contest-list-header-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1.2fr 1.2fr 0.9fr 0.9fr 1.5fr 1.2fr 1.5fr;
    gap: 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 4px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
}

.contest-list-header-cell {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    white-space: nowrap;
}

.contest-list-header-cell.contest-actions-header {
    text-align: right;
}

.contest-list-row {
    background: #ffffff;
    border-radius: 4px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.contest-list-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.contest-list-row-content {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1.2fr 1.2fr 0.9fr 0.9fr 1.5fr 1.2fr 1.5fr;
    gap: 20px;
    align-items: center;
}

/* Contest Title Cell */
.contest-title-cell {
    min-width: 0;
}

.contest-list-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.contest-list-banner {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contest-list-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contest-list-title-info {
    flex: 1;
    min-width: 0;
}

.contest-list-title {
    font-size: 16px;
    font-weight: 700;
    color: #232946;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.contest-list-description {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Status Cell */
.contest-status-cell {
    display: flex;
    justify-content: flex-start;
}

.contest-status {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.5px;
    display: inline-block;
}

.contest-status.status-upcoming,
.status-upcoming {
    background: rgba(255, 214, 160, 0.2);
    color: #8b5a2b;
}

.contest-status.status-active,
.status-active {
    background: rgba(184, 224, 210, 0.2);
    color: #2d5a4a;
}

.contest-status.status-ended,
.status-ended {
    background: rgba(255, 214, 160, 0.2);
    color: #cc0000;
}

/* Date Cell */
.contest-date-cell {
    min-width: 0;
}

.contest-list-date {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contest-list-date-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.contest-list-date small {
    font-size: 11px;
    color: #64748b;
    display: block;
    line-height: 1.4;
}

.countdown-timer small,
.end-countdown-timer small {
    color: #f59e0b;
    font-weight: 600;
}

.countdown-timer.urgent small,
.end-countdown-timer.urgent small {
    color: #dc2626;
}

/* Info Cell */
.contest-info-cell {
    min-width: 0;
}

.contest-list-info {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* Prizes Cell */
.contest-prizes-cell {
    min-width: 0;
}

.contest-list-prizes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prize-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
}

.prize-badge.prize-rank-1 {
    background: rgba(255, 215, 0, 0.15);
    color: #b8860b;
}

.prize-badge.prize-rank-2 {
    background: rgba(192, 192, 192, 0.15);
    color: #6b7280;
}

.prize-badge.prize-rank-3 {
    background: rgba(205, 127, 50, 0.15);
    color: #92400e;
}

/* Participants Cell */
.contest-participants-cell {
    min-width: 0;
}

.contest-list-participants {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participants-count {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.participants-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(251, 191, 36, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.participants-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #ea580c 100%);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.participants-progress-bar .progress-fill.progress-full {
    background: linear-gradient(135deg, #2d5a4a 0%, #2d5a4a 100%);
}

/* Actions Cell */
.contest-actions-cell {
    display: flex;
    justify-content: flex-end;
}

.contest-list-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.contest-list-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.contest-list-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 70%,
        rgba(255, 255, 255, 0) 100%
    );
    z-index: 1;
    transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.contest-list-btn:hover::before {
    left: 100%;
}

.contest-list-btn span {
    position: relative;
    z-index: 2;
}

.contest-list-btn.btn-primary {
    background: #fbbf24;
    color: #ffffff;
}

.contest-list-btn.btn-primary:hover {
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    transform: translateY(-1px);
}

.contest-list-btn.btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.contest-list-btn.btn-secondary:hover {
    background: #4b5563;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
    transform: translateY(-1px);
}

.contest-list-btn.btn-danger {
    background: rgba(255, 0, 0, 0.1);
    color: #cc0000;
}

.contest-list-btn.btn-danger:hover {
    background: rgba(255, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .contest-list-header-row,
    .contest-list-row-content {
        grid-template-columns: 2fr 0.9fr 1.1fr 1.1fr 0.8fr 0.8fr 1.3fr 1.1fr 1.3fr;
        gap: 16px;
    }
}

@media (max-width: 1200px) {
    .contest-list-header-row,
    .contest-list-row-content {
        grid-template-columns: 2fr 1fr 1fr 1fr 0.9fr 0.9fr 1.2fr 1fr 1.2fr;
        gap: 14px;
    }
    
    .contest-list-title {
        font-size: 15px;
    }
    
    .contest-list-description {
        font-size: 12px;
    }
}

@media (max-width: 992px) {
    .contest-list-header-row {
        display: none; /* Hide header on mobile */
    }
    
    .contest-list-row {
        padding: 18px 20px;
    }
    
    .contest-list-row-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .contest-list-cell {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .contest-list-cell:last-child {
        border-bottom: none;
    }
    
    .contest-list-cell::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-right: 16px;
        flex-shrink: 0;
    }
    
    .contest-title-cell::before {
        content: 'Contest';
    }
    
    .contest-status-cell::before {
        content: 'Status';
    }
    
    .contest-date-cell::before {
        content: 'Date';
    }
    
    .contest-info-cell::before {
        content: attr(data-label);
    }
    
    .contest-prizes-cell::before {
        content: 'Prizes';
    }
    
    .contest-participants-cell::before {
        content: 'Participants';
    }
    
    .contest-actions-cell::before {
        content: 'Actions';
    }
    
    .contest-actions-cell {
        justify-content: flex-start;
    }
    
    .contest-list-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    /* Filter Controls - Full Width on Mobile */
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .filter-controls .filter-form {
        width: 100%;
        flex: none;
    }
    
    /* Ensure select dropdown text is visible on mobile */
    .filter-input select,
    select.filter-input {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        min-height: 56px !important;
        height: 56px !important;
        padding-right: 45px !important;
        padding-left: 15px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        box-sizing: border-box !important;
    }
    
    /* Hide View Toggle on Mobile - Both views look similar */
    .view-toggle-container {
        display: none !important;
    }
    
    .contests-list-wrapper {
        gap: 12px;
    }
    
    .contest-list-row {
        padding: 16px;
        border-radius: 4px;
    }
    
    .contest-list-title-wrapper {
        gap: 12px;
    }
    
    .contest-list-banner {
        width: 50px;
        height: 50px;
    }
    
    .contest-list-title {
        font-size: 14px;
    }
    
    .contest-list-description {
        font-size: 12px;
    }
    
    .contest-list-date-value,
    .contest-list-info,
    .participants-count {
        font-size: 13px;
    }
    
    .contest-list-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .prize-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}

@media (max-width: 640px) {
    /* Filter Controls - Smaller Mobile */
    .filter-controls {
        padding: 16px;
    }
    
    /* View toggle already hidden at 768px, no need to repeat */
    
    .contest-list-row {
        padding: 14px;
    }
    
    .contest-list-banner {
        width: 45px;
        height: 45px;
    }
    
    .contest-list-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .contest-list-btn {
        width: 100%;
    }
}
