/* --- CSS VARIABLES & RESET --- */
:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --accent-color: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: transparent;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.video-background {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
    opacity: 90%;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- CONTAINER --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- HEADER SECTION --- */
header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

p.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* --- CONTROLS (Search & Filter) --- */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    margin: 0 auto 3rem auto;
    width: auto;
}

.filter-btns {
    display: inline-flex;
    gap: 0.5rem;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- EVENTS GRID --- */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* --- EVENT CARD DESIGN --- */
.event-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    opacity: 0;
    /* For load animation */
    animation: fadeUp 0.6s forwards;
    position: relative;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Image Wrapper with Overlay */
.card-image {
    height: 200px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .card-image img {
    transform: scale(1.1);
}

.category-tag {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.tag-online {
    background: #10b981;
    color: #000;
}

/* Green */
.tag-offline {
    background: #f43f5e;
    color: #fff;
}

/* Red */

/* Card Content */
.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-date {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.event-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.event-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Hidden details that appear/expand */
.event-details {
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
    margin-top: auto;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Register Button */
.register-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: white;
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    text-decoration: none;
}

.register-btn:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* --- ANIMATIONS --- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .filter-btns {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .filter-btn {
        flex: 0 1 auto;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    .filter-btn {
        flex: 1 1 45%;
        text-align: center;
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .event-card:hover {
        transform: none;
        /* Disable hover lift on mobile */
    }
}

/* ================= Modal Styles ================= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid #7A38FC;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(122, 56, 252, 0.4);
    position: relative;
    animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.close-btn:hover,
.close-btn:focus {
    color: #FF2E63;
    text-decoration: none;
    cursor: pointer;
}

.rule-container {
    padding-left: 30px;
}
.modal-header {
    padding: 20px 60px 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: #00ffe7;
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(0, 255, 231, 0.3);
}

.modal-tag {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.modal-body-content {
    display: flex;
    flex-direction: column;
    padding: 30px;
    gap: 10px;
}

.modal-info {
    color: #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.modal-date,
.modal-location {
    font-size: 1.1rem;
    color: #FF2E63;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-desc {
    margin: 20px 0;
    line-height: 1.6;
    font-size: 1rem;
    color: #aaa;
    padding-left: 10px;
}

.modal-actions {
    margin-top: 30px;
    text-align: center;
}

.download-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, #7A38FC, #FF2E63);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(122, 56, 252, 0.4);
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(122, 56, 252, 0.6);
}

/* @media (min-width: 768px) {
    .modal-body-content {
         flex-direction: column; 
    }
} */

/* --- EVENT TIMELINE STYLES --- */
.timeline-toggle-area {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.timeline-toggle-btn {
    background: transparent;
    border: 2px solid #7A38FC;
    color: #fff;
    padding: 10px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 0 10px rgba(122, 56, 252, 0.4);
}

.timeline-toggle-btn:hover {
    background: #7A38FC;
    box-shadow: 0 0 20px #7A38FC;
    transform: scale(1.05);
}

.timeline-wrapper {
    width: 100%;
    display: none;
    margin-bottom: 2rem;
}

.flowchart {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.flowchart .heading {
    text-align: center;
    margin-bottom: 30px;
}

.flowchart .heading h2 {
    color: #ffffff;
    font-size: 2.5rem;
    margin: 15px 0;
    letter-spacing: 1px;
    text-shadow: 0 0 15px #ff3700, 0 0 35px #FF2E63;
}

.flowchart .heading p {
    color: #eaeaea;
    text-align: center;
    margin-bottom: 30px;
}

.timeline-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.timeline-btn {
    background: transparent;
    border: 2px solid #7A38FC;
    color: #fff;
    padding: 10px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 0 10px rgba(122, 56, 252, 0.2);
}

.timeline-btn:hover,
.timeline-btn.active {
    background: #7A38FC;
    box-shadow: 0 0 20px #7A38FC, 0 0 40px #FF2E63;
    transform: scale(1.05);
}

.timeline-container {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    position: relative;
    padding: 20px 0;
}

.timeline-container.active {
    display: flex;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, transparent, #7A38FC, #FF2E63, transparent);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(122, 56, 252, 0.5);
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 50px;
    position: relative;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 20px;
    height: 20px;
    background: #000;
    border: 4px solid #FF2E63;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 0 0 20px #FF2E63;
    transition: all 0.3s ease;
}

.timeline-item:hover::after {
    background: #FF2E63;
    box-shadow: 0 0 30px #FF2E63, 0 0 60px #7A38FC;
    transform: translateX(-50%) scale(1.2);
}

.timeline-item .time,
.timeline-item .content,
.timeline-item .events-wrapper {
    width: 45%;
}

.timeline-item .time {
    text-align: right;
    font-size: 1.3rem;
    color: #FF2E63;
    font-weight: 800;
    padding-right: 40px;
    text-shadow: 0 0 10px rgba(255, 46, 99, 0.5);
}

.timeline-item .content {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    margin-left: auto;
    position: relative;
    overflow: hidden;
}

.timeline-item .events-wrapper .content {
    width: 100%;
    margin-bottom: 20px;
    margin-left: 0;
}

.timeline-item .events-wrapper .content:last-child {
    margin-bottom: 0;
}

.timeline-item .content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(122, 56, 252, 0.1), rgba(255, 46, 99, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-item .content:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: #7A38FC;
    box-shadow: 0 0 30px rgba(122, 56, 252, 0.4);
}

.timeline-item .content:hover::before {
    opacity: 1;
}

.timeline-item .content h3 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.timeline-item .content .tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    background: rgba(122, 56, 252, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(122, 56, 252, 0.4);
    margin-top: 8px;
    position: relative;
    z-index: 1;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.timeline-item .content .tag.break {
    background: rgba(255, 165, 0, 0.15);
    color: #ffd700;
    border-color: rgba(255, 165, 0, 0.4);
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-item:nth-child(even) .time {
    text-align: left;
    padding-right: 0;
    padding-left: 40px;
}

@media (max-width: 768px) {
    .timeline-container::before {
        left: 30px;
    }

    .timeline-item {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 70px;
        margin-bottom: 40px;
    }

    .timeline-item::after {
        left: 30px;
        transform: translateX(-50%);
    }

    .timeline-item:hover::after {
        transform: translateX(-50%) scale(1.2);
    }

    .timeline-item .time {
        width: 100%;
        text-align: left;
        padding: 0;
        margin-bottom: 12px;
        font-size: 1.1rem;
        padding-left: 5px;
    }

    .timeline-item .content,
    .timeline-item .events-wrapper {
        width: 100%;
        margin-left: 0;
    }

    .timeline-item .content {
        padding: 20px;
    }
}

/* --- DYNAMIC EVENT CONTENT STYLES --- */
.event-details-content {
    color: #eaeaea;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.5s ease;
}

.event-details-content .section-title {
    color: #00ffe7;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 25px 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid #FF2E63;
    padding-left: 10px;
}

.event-details-content p {
    line-height: 1.7;
    margin-bottom: 15px;
    color: #ccc;
    font-size: 0.95rem;
}

.event-details-content .details-list {
    list-style: none;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.event-details-content .details-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.event-details-content .details-list li strong {
    color: #7A38FC;
    width: 100px;
    display: inline-block;
}

.event-details-content .round-section {
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 2px solid #7A38FC;
}

.event-details-content .round-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #FF2E63;
    font-weight: 700;
}

.event-details-content .disclaimer {
    text-align: center;
    font-style: italic;
    color: #aaa;
    margin-top: 30px;
    padding: 15px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}