:root {
    --primary-purple: #6366f1;
    --primary-pink: #ec4899;
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

.events-page {
    min-height: 100vh;
    background: #ffffff;
    padding-bottom: 4rem;
}

/* Hero Section */
.events-hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.9));
    padding: 4rem 0 3rem;
    margin-bottom: 2rem;
}

.hero-content {
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(90deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.filter-label i {
    margin-right: 0.5rem;
    color: var(--primary-purple);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.filter-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: white;
    border-color: var(--primary-purple);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.3);
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

/* ===== Event Card ===== */
.event-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Banner - fixed height, cover fit */
.event-banner {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    flex-shrink: 0;
}

.event-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-banner-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.8);
}

.event-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-800);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.accepting-badge {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: var(--success-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Content area - flex grow to fill remaining space */
.event-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.88rem;
}

.meta-item i {
    color: var(--primary-purple);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Description - stripped HTML, clamped lines */
.event-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer - pushed to bottom via flex */
.event-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
    margin-bottom: 0.75rem;
}

.event-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stat-badge {
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.stat-badge.prize {
    background: #fef3c7;
    color: #92400e;
}

.stat-badge.participants {
    background: #dbeafe;
    color: #1e40af;
}

.stat-badge.applications {
    background: #e0e7ff;
    color: #4338ca;
}

/* View details button - full width, always at bottom */
.btn-view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.btn-view-details:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    color: white;
}

/* Deadline / ended info */
.deadline-info {
    background: #fef3c7;
    color: #92400e;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.days-left {
    font-weight: 700;
}

.event-ended {
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.82rem;
    text-align: center;
}

/* No Events State */
.no-events {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    color:red;
}

.no-events i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.no-events h3 {
    color: var(--gray-700);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-events p {
    color: var(--gray-500);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .filter-btn {
        text-align: center;
    }
}
