/**
 * Competition Tickets System V4 - Public Styles
 * Developed by You Can Fly Media
 * https://youcanflymedia.co.uk
 */

/* ===== MODERN PUBLIC INTERFACE ===== */
.cts-v4-public {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
}

/* ===== COMPETITIONS GRID ===== */
.cts-v4-competitions {
    margin: 2rem 0;
}

.cts-v4-competitions h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

.competitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.competition-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.competition-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.competition-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    position: relative;
}

.competition-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.competition-card h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.competition-card-body {
    padding: 1.5rem;
}

.prize-info {
    font-size: 1.8rem;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 1rem;
    text-align: center;
}

.ticket-price {
    text-align: center;
    margin-bottom: 1rem;
}

.ticket-price .free {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-price .paid {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.end-date {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.enter-competition-btn,
.login-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.enter-competition-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.enter-competition-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-btn {
    background: #6c757d;
    color: white;
}

.login-btn:hover {
    background: #5a6268;
    color: white;
}

/* ===== GAMES GRID ===== */
.cts-v4-games {
    margin: 2rem 0;
}

.cts-v4-games h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.game-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

.game-card-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 1rem;
}

.game-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.game-card-body {
    padding: 1.5rem;
}

.game-card p {
    margin: 0 0 1rem 0;
    color: #6c757d;
    line-height: 1.5;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.play-game-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-game-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* ===== WALLET ===== */
.cts-v4-wallet {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    margin: 2rem 0;
}

.wallet-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wallet-balance {
    font-size: 3rem;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.wallet-balance-label {
    color: #6c757d;
    font-size: 1.1rem;
}

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.wallet-btn {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.wallet-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

/* ===== LEADERBOARD ===== */
.cts-v4-leaderboard {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    margin: 2rem 0;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.leaderboard-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.leaderboard-item:hover {
    background: #f8f9fa;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-right: 1rem;
    min-width: 3rem;
}

.leaderboard-rank.first {
    color: #ffd700;
}

.leaderboard-rank.second {
    color: #c0c0c0;
}

.leaderboard-rank.third {
    color: #cd7f32;
}

.leaderboard-player {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.leaderboard-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #28a745;
}

/* ===== MY TICKETS ===== */
.cts-v4-my-tickets {
    margin: 2rem 0;
}

.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.ticket-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.ticket-card h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.ticket-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.ticket-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ticket-status.active {
    background: #d4edda;
    color: #155724;
}

.ticket-status.expired {
    background: #f8d7da;
    color: #721c24;
}

/* ===== WOOCOMMERCE GAMES ===== */
.cts-v4-woocommerce-games {
    margin: 2rem 0;
}

.woocommerce-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.woocommerce-game-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.woocommerce-game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.woocommerce-game-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.woocommerce-game-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.woocommerce-game-body {
    padding: 1.5rem;
}

.game-description {
    margin-bottom: 1.5rem;
    color: #6c757d;
    line-height: 1.6;
}

.game-rewards {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.game-rewards h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.reward-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.play-woocommerce-game-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-woocommerce-game-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .competitions-grid,
    .games-grid,
    .tickets-grid,
    .woocommerce-games-grid {
        grid-template-columns: 1fr;
    }
    
    .cts-v4-competitions h2,
    .cts-v4-games h2 {
        font-size: 1.5rem;
    }
    
    .wallet-balance {
        font-size: 2rem;
    }
    
    .wallet-actions {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .leaderboard-rank {
        margin-right: 0;
    }
}

/* ===== LOADING STATES ===== */
.cts-v4-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.cts-v4-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: cts-v4-spin 1s linear infinite;
}

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

/* ===== EMPTY STATES ===== */
.cts-v4-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.cts-v4-empty-state h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.cts-v4-empty-state p {
    margin: 0;
    font-size: 1.1rem;
}
