:root {
    --bg-color: #121212;
    --primary-color: #1e1e1e;
    --text-color: #e0e0e0;
    --accent-color-1: #e94057;
    --accent-color-2: #8a2387;
    --font-family: 'Poppins', sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%; /* Ensure html and body take full document height */
    display: flex;
    flex-direction: column;
}

/* Video Background Styles */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* Place video behind other content */
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the entire container */
    filter: blur(15px); /* Adjusted blur to 15px */
    transform: scale(1.05); /* Slightly scale to hide blur edges */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dark semi-transparent overlay */
    z-index: 0; /* Above the video, below other content */
}

/* Ensure content is above the video background */
body {
    font-family: var(--font-family);
    background-color: var(--bg-color); /* Default background color for pages without video */
    color: var(--text-color);
    line-height: 1.6;
    position: relative; /* Needed for z-index on content to be above video, if applicable */
}

body.body-with-video {
    background-color: transparent; /* Transparent for video background */
}


.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
    position: relative; /* Ensure container content is above overlay */
    z-index: 1;
}

h1, h2 {
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--accent-color-1), var(--accent-color-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
}

.hero {
    background: rgba(30, 30, 30, 0.7); /* Original background */
    text-align: center;
    padding: 4rem 2rem;
    position: relative; /* Ensure hero content is above overlay */
    z-index: 1;
}

.hero .subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cta-button, .submit-button {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(90deg, var(--accent-color-1), var(--accent-color-2));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover, .submit-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(233, 64, 87, 0.5);
}

section {
    padding: 4rem 0;
    position: relative; /* Ensure sections are above the video overlay */
    z-index: 1;
}

#how-it-works .steps {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    text-align: center;
}

#how-it-works .step {
    background: rgba(30, 30, 30, 0.7); /* Changed from var(--primary-color) */
    padding: 2rem;
    border-radius: 10px;
    flex: 1;
    transition: transform 0.3s ease;
}

#how-it-works .step:hover {
    transform: translateY(-10px);
}

#how-it-works .step span {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--accent-color-1), var(--accent-color-2));
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

#form-section {
    background: rgba(30, 30, 30, 0.7); /* Changed from var(--primary-color) */
    padding: 3rem;
    border-radius: 10px;
    margin-top: 2rem;
    position: relative; /* Ensure form is above overlay */
    z-index: 1;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid #555;
    background: #333;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color-1);
    box-shadow: 0 0 10px rgba(233, 64, 87, 0.3);
}

.submit-button {
    width: 100%;
    margin-top: 1rem;
}

#form-message {
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

.hidden {
    display: none;
}

main {
    flex-grow: 1;
}

footer {
    text-align: center;
    padding: 2rem;
    background: rgba(30, 30, 30, 0.7);
    font-size: 0.9rem;
    color: #888;
    z-index: 1;
    border-top: 2px solid var(--accent-color-1); /* Reintroduce the red line above the footer */
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    .hero {
        padding: 3rem 1rem;
    }
    #how-it-works .steps {
        flex-direction: column;
    }
    .container {
        padding: 1rem;
    }
}

/* Dashboard Grid Styles */
#participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive grid */
    gap: 20px;
    margin-top: 2rem;
    padding: 0 20px;
}

.participant-card {
    background-color: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative; /* For delete button positioning */
    min-height: 350px; /* Ensure cards have a minimum height */
}

.participant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.participant-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card-details {
    padding: 15px;
    flex-grow: 1; /* Allow details to take available space */
}

.participant-card h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.3rem;
    color: var(--accent-color-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-card p {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #bbb;
}

.participant-card .delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    font-size: 0.75rem;
    background-color: rgba(217, 83, 79, 0.8); /* Slightly transparent red */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 10; /* Ensure button is above other content */
}

.participant-card .delete-btn:hover {
    background-color: #d9534f;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 10000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: var(--primary-color);
    margin: 5% auto; /* 5% from the top and centered */
    padding: 30px;
    border: 1px solid #555;
    border-radius: 10px;
    width: 90%; /* Could be more responsive */
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    animation-name: animatetop;
    animation-duration: 0.4s
}

/* Add Animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 38px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--accent-color-1);
    text-decoration: none;
    cursor: pointer;
}

.modal-body p {
    margin-bottom: 0.5rem;
}

.modal-body strong {
    color: var(--accent-color-1);
}

/* Adjust dashboard-container for grid layout */
.dashboard-container {
    overflow-x: hidden; /* No longer need horizontal scroll for table */
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

/* Ensure images in modal scale properly */
#modal-participant-photo {
    max-width: 250px; /* Limit width of modal image */
    height: auto;
    border-radius: 8px;
    margin: 0 auto 1rem auto; /* Center image */
    display: block;
}

@media (max-width: 768px) {
    #participants-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
        padding: 0 10px;
    }

    .modal-content {
        width: 95%;
        margin: 20px auto;
    }

    #modal-participant-photo {
        max-width: 100%; /* Allow full width on smaller modal */
    }
}

/* Login Page Styles */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative; /* Ensure login content is above overlay */
    z-index: 1;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    background: var(--primary-color);
    border-radius: 10px;
    text-align: center;
}

.login-box h1 {
    font-size: 2rem;
}

.error-message {
    color: var(--accent-color-1);
    min-height: 1.5em; /* Reserve space for the error message */
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Navbar Styles */
.navbar {
    background-color: rgba(0, 0, 0, 0.7); /* Changed from 0.8 to 0.7 for consistency */
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure navbar is above video and overlay */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem; /* Adjust padding for navbar container */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(90deg, var(--accent-color-1), var(--accent-color-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.navbar-nav {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar-nav li {
    margin-left: 2rem;
}

.navbar-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.navbar-nav a:hover {
    color: var(--accent-color-1);
}

/* Hamburger menu toggle button */
.menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color); /* Color of the SVG icon */
}

.menu-toggle svg {
    width: 25px;
    height: 25px;
    vertical-align: middle;
}

.menu-toggle svg rect {
    fill: var(--text-color);
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: row; /* Keep brand and toggle in a row */
        justify-content: space-between;
        align-items: center;
    }
    
    .menu-toggle {
        display: block; /* Show hamburger on mobile */
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        display: none; /* Hidden by default on mobile */
        text-align: center;
        background-color: rgba(0, 0, 0, 0.8);
        padding: 1rem 0;
        border-radius: 5px;
    }

    .navbar-nav.nav-active {
        display: flex; /* Show when active */
    }

    .navbar-nav li {
        margin: 0.5rem 0;
    }
}

/* Snow background container */
.snow-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Contains the snowflakes */
    pointer-events: none; /* Allows clicks to pass through */
    z-index: -2; /* Ensures it's behind everything else */
}

/* Snow effect styles */
.snowflake {
    position: absolute; /* Changed from fixed to absolute, relative to .snow-background */
    background-color: #fff;
    border-radius: 50%;
    opacity: 0.8;
    pointer-events: none; /* Allows clicks to pass through */
    animation: fall linear infinite;
    z-index: 1; /* Relative to .snow-background container */
}

@keyframes fall {
    0% {
        top: -10%; /* Start above the viewport */
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        top: 100%; /* Fall below the viewport */
        opacity: 0;
    }
}

/* Styles for Quadro selection in inscricao.html */
.quadros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.hidden-checkbox {
    display: none;
}

.quadro-button {
    display: block;
    padding: 15px 20px;
    border: 2px solid var(--accent-color-1);
    border-radius: 10px;
    background-color: var(--primary-color);
    color: var(--text-color);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
}

.quadro-button:hover {
    background-color: rgba(233, 64, 87, 0.2); /* Lighter accent on hover */
    border-color: var(--accent-color-2);
}

/* Style for selected (checked) state */
.hidden-checkbox:checked + .quadro-button {
    background: linear-gradient(90deg, var(--accent-color-1), var(--accent-color-2));
    color: #fff;
    border-color: var(--accent-color-2);
    box-shadow: 0 0 15px rgba(233, 64, 87, 0.5);
}