:root {
    --card-bg: #1f122e;
    --shadow-dark: rgba(0, 0, 0, 0.6);
    --accent-color: #e040fb;
    --text-light: #f5eef9;
    --text-muted: #c9a4e0;
    --gradient-end: #ab47bc;
    --gradient-start: #7b1fa2;
}



.lottery-header {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px var(--shadow-dark);
    border: 1px solid rgba(224, 64, 251, 0.3);
    text-align: center;
}

.lottery-header h1 {
    color: #fffcff;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(224, 64, 251, 0.5);
}

.lottery-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.lottery-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(224, 64, 251, 0.3);
    box-shadow: 0 8px 32px var(--shadow-dark);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.stat-card .stat-info {
    margin-top: 0.5rem;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-dark);
}

.stat-card i {
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

.section-title {
    color: #ffffff;
    font-size: 1.8rem;
    margin: 2rem 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lottery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.lottery-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(224, 64, 251, 0.3);
    box-shadow: 0 8px 32px var(--shadow-dark);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.lottery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px var(--shadow-dark);
    border-color: var(--accent-color);
}

.lottery-image {
    height: 250px;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lottery-image img {
    max-width: 110%;
    max-height: 110%;
    object-fit: contain;
    border-radius: 10px;
}

.lottery-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.lottery-title {
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.lottery-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    flex-grow: 1;
}

.prize-info {
    background: rgba(224, 64, 251, 0.1);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid rgba(224, 64, 251, 0.3);
}

.prize-value {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
}

.lottery-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.meta-item {
    text-align: center;
}

.meta-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.meta-value {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: bold;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    background: linear-gradient(90deg, var(--accent-color), var(--gradient-end));
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.lottery-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem; /* Changed from margin-top: auto to 1rem for consistent spacing */
}

.buy-ticket-btn {
    flex: 1;
    background: linear-gradient(45deg, var(--accent-color), var(--gradient-end));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-ticket-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(224, 64, 251, 0.4);
}

.buy-ticket-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.view-details-btn {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-details-btn:hover {
    background: var(--accent-color);
    color: white;
}

.completed-lottery-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(224, 64, 251, 0.3);
    box-shadow: 0 4px 20px var(--shadow-dark);
}

.completed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.completed-title {
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: bold;
}

.winner-badge {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap; /* Prevent winner name from wrapping too early */
}

.completed-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.countdown-timer {
    background: rgba(224, 64, 251, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1rem;
    border: 1px solid rgba(224, 64, 251, 0.3);
}

.countdown-text {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.user-ticket-info {
    background: rgba(224, 64, 251, 0.1);
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid rgba(224, 64, 251, 0.3);
}

.user-ticket-count {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.error-message-box {
    background-color: #ffdddd;
    border: 1px solid #f44336;
    color: #f44336;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
}


@media (max-width: 768px) {
    .lottery-grid {
        grid-template-columns: 1fr;
    }
    
    .lottery-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Adjusted for smaller screens */
    }
    
    .lottery-meta {
        grid-template-columns: 1fr;
    }
    .stat-card h3 {
        font-size: 1.5rem;
    }
    .stat-card i {
        font-size: 1.5rem;
    }
}