/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Arial', sans-serif;
    background: #ffffff;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Container dos eventos com altura total */
#events-container {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
}

/* Header */
header {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    position: relative;
}

.logo {
    height: 60px;
    width: auto;
}

.carousel-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.carousel-controls label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.carousel-controls select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    outline: none;
}

/* Main content */
main {
    padding: 0;
    width: 100%;
    overflow: hidden;
}

h1 {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Grid de modalidades */
.modalities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Grid de eventos */
.events-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 40px;
    min-height: 500px;
    transition: all 0.3s ease;
    position: relative;
}

/* Seções */
section {
    margin-bottom: 60px;
}

h2 {
    text-align: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Evento card */
.event-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 30px;
    border: 1px solid #ddd;
    width: 100vw;
    height: calc(100vh - 70px);
    max-width: none;
    position: relative;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Logo CENFA no canto superior esquerdo do event-card */
.event-card::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    background-image: url('/static/images/logo-cenfa-dark.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.9;
    z-index: 1;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
    gap: 15px;
    position: relative;
    z-index: 2;
    text-align: center;
}

.club-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.club-logo {
    height: 60px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.club-name {
    font-size: 0.85rem;
    color: #555;
    font-weight: 500;
    text-align: center;
    max-width: 120px;
    line-height: 1.2;
}

.event-title {
    color: #333;
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
    flex: 1;
}

.event-date {
    background: #333;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.event-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.event-detail {
    background: #f9f9f9;
    padding: 12px 16px;
    border-radius: 4px;
    border-left: 3px solid #333;
}

.event-detail strong {
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-detail span {
    color: #333;
    font-size: 1rem;
    font-weight: 500;
}

/* Status do evento com cores */
.event-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-finished {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-default {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* Modalidade do evento */
.event-modality {
    color: #333 !important;
    font-weight: 600 !important;
    font-style: italic;
}

/* Participantes */
.participants-title {
    color: #333;
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.participants-count {
    background: #333;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.participants-section {
    max-height: calc(100vh - 350px);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.participants-section::-webkit-scrollbar {
    width: 8px;
}

.participants-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.participants-section::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.participants-section::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.participants-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.participant-card {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.participant-rank {
    position: relative;
    top: 0;
    right: 0;
    background: #333;
    color: white;
    min-width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    z-index: 10;
    flex-shrink: 0;
}

.participant-rank.rank-1 {
    background: #FFD700;
    color: #333;
}

.participant-rank.rank-2 {
    background: #C0C0C0;
    color: #333;
}

.participant-rank.rank-3 {
    background: #CD7F32;
    color: white;
}

.participant-photo {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    border: 2px solid #ccc;
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.photo-placeholder {
    font-size: 20px;
    color: #999;
}

.participant-info {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.participant-name {
    color: #333;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 2px;
    flex: 1;
    min-width: 200px;
}

.participant-score {
    color: #000;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0;
    min-width: 80px;
    text-align: right;
}

.participant-details {
    font-size: 0.85rem;
    color: #666;
    min-width: 150px;
}

.participant-results-count {
    background: #e0e0e0;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-block;
    font-weight: 500;
    white-space: nowrap;
}

.modality-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
    overflow: hidden;
}

/* Cards com imagem de fundo */
.modality-card.has-background-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.modality-card.has-background-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    border-radius: 15px;
    z-index: 1;
}

.modality-card.has-background-image * {
    position: relative;
    z-index: 2;
}

.modality-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.modality-card h3 {
    color: #4a5568;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.modality-card.has-background-image h3 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
}

.modality-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.modality-card.has-background-image p {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.modality-card .highlight {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 10px;
}

.modality-card.has-background-image .highlight {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: bold;
}

/* Estados de carregamento e erro */
.loading {
    position: relative;
    top: 50%;
    left: 40%;
    margin-top: 100px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin-bottom: 30px;
    margin-left: 50px;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 6px solid #d3d3d3;
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner::after {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #4a5568;
    font-weight: 600;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.loading-subtext {
    color: #718096;
    font-size: 1rem;
    font-weight: 400;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 5px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #000000;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.error {
    background: rgba(255, 0, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 0, 0, 0.3);
}
.info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin: 40px auto;
    max-width: 800px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px);
    border: 2px solid #000;
}

.info-card h3 {
    color: #000;
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

.info-card p {
    color: #000;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.info-steps {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    margin-top: 25px;
    border-left: 5px solid #000;
}

.info-steps h4 {
    color: #2d3748;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.info-steps ol {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.8;
    padding-left: 20px;
    margin-bottom: 20px;
}

.info-steps li {
    margin-bottom: 8px;
}

.info-steps code {
    background: #e2e8f0;
    color: #667eea;
    padding: 2px 8px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.info-steps p {
    text-align: left;
    font-weight: 500;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 15px;
}

#current-modality-uid {
    color: #667eea;
    font-family: 'Courier New', monospace;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 5px;
}

/* Estilos de erro */
.error {
    background: rgba(255, 0, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    text-align: center;
    padding: 40px;
    color: #c53030;
    font-size: 1.2rem;
}

.error button {
    margin-top: 20px;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.error button:hover {
    background: #5a67d8;
}

/* Animações */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsividade */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .logo {
        height: 60px;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .carousel-controls {
        order: -1;
    }
    
    .modalities-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modality-card {
        padding: 20px;
    }
    
    /* Eventos responsivos */
    .event-card {
        padding: 20px;
        margin-bottom: 20px;
        width: 95vw;
        height: 65vh;
    }
    
    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .event-title {
        font-size: 1.4rem;
    }
    
    .event-info {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .participants-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .participant-card {
        padding: 12px;
        gap: 10px;
    }
    
    .participant-photo {
        width: 45px;
        height: 45px;
    }
    
    .photo-placeholder {
        font-size: 18px;
    }
    
    .participants-title {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Indicador de progresso do carousel */
.carousel-progress {
    position: fixed;
    bottom: 5px;
    right: 5px;
    background: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}