/* Custom CSS for EXTREME CACHOEIRINHA */

:root {
    --primary-color: #28a745;
    --secondary-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.hero-section {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.hero-section .card {
    border: none;
    border-radius: 15px;
}

.hero-section .card-header {
    border-radius: 15px 15px 0 0 !important;
}

/* Animações */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.btn {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Form styling */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Icons */
.fa-mountain {
    color: #fff;
}

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }

/* Map container */
#map {
    border: 3px solid var(--primary-color);
}

/* Footer */
footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    #map {
        height: 300px !important;
    }
}

/* Admin styles */
.admin-sidebar {
    background: linear-gradient(135deg, var(--dark-color) 0%, #495057 100%);
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 15px 20px;
    border-radius: 10px;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.admin-content {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
}

.stats-card {
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: none;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.stats-card p {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.stats-card i {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.stats-card.success {
    background: rgba(40, 167, 69, 0.95);
}

.stats-card.warning {
    background: rgba(255, 193, 7, 0.9);
    color: #212529 !important;
}

.stats-card.warning h3,
.stats-card.warning p,
.stats-card.warning i {
    color: #212529 !important;
    text-shadow: none;
}

.stats-card.danger {
    background: rgba(40, 167, 69, 0.9);
}

.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.table th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 500;
}

/* QR Code scanner */
.qr-scanner {
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    overflow: hidden;
}

#qr-video {
    width: 100%;
    height: auto;
}

.qr-result {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

/* PDF styles */
.pdf-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.qr-code-container {
    text-align: center;
    padding: 20px;
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    margin: 20px 0;
}

/* Success/Error messages */
.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

/* Login form */
.login-container {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* =============== ADMIN RESPONSIVE =============== */

/* Mobile Menu Toggle Button */
.admin-mobile-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-mobile-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.admin-mobile-toggle i {
    font-size: 1.2rem;
}

/* Tablet and Mobile */
@media (max-width: 968px) {
    body {
        overflow-x: hidden;
    }
    
    .admin-mobile-toggle {
        display: block;
    }
    
    .d-flex {
        flex-direction: column;
    }
    
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .admin-sidebar.show {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    
    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    
    .admin-sidebar-overlay.show {
        display: block;
    }
    
    .admin-content {
        width: 100%;
        margin-left: 0;
        padding: 70px 15px 20px 15px;
    }
    
    /* Stats Cards */
    .row.mb-4 .col-md-3,
    .row.mb-4 .col-md-6,
    .row.mb-4 .col-lg-6,
    .row.mb-4 .col-lg-8,
    .row.mb-4 .col-lg-4 {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    /* Cards */
    .card {
        margin-bottom: 15px;
    }
    
    /* Header actions */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 15px;
    }
    
    .d-flex.justify-content-between > div {
        width: 100%;
    }
    
    /* Buttons */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* Form controls */
    .form-control,
    .form-select {
        font-size: 16px; /* Previne zoom no iOS */
    }
}

@media (max-width: 576px) {
    .admin-content {
        padding: 60px 10px 15px 10px;
    }
    
    h2, h3, h4 {
        font-size: 1.3rem;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Esconder colunas menos importantes em mobile */
    .table td:nth-child(3),
    .table th:nth-child(3),
    .table td:nth-child(4),
    .table th:nth-child(4) {
        display: none;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .table-actions .btn {
        width: 100%;
        margin: 2px 0;
    }
}

/* ===================================
   ÁREA DO PARTICIPANTE - MOBILE FIX
   =================================== */
@media (max-width: 768px) {
    /* Melhorar layout das tabelas na área do participante */
    .area-participante .table {
        font-size: 0.85rem;
    }
    
    .area-participante .table td,
    .area-participante .table th {
        padding: 0.5rem 0.3rem;
        word-break: break-word;
    }
    
    .area-participante .table td:first-child {
        width: 40%;
        font-weight: 600;
    }
    
    /* Cards responsivos */
    .area-participante .card-body {
        padding: 1rem;
    }
    
    .area-participante .row .col-md-6 {
        margin-bottom: 1.5rem;
    }
    
    /* Botões de ação em coluna */
    .area-participante .btn {
        width: 100%;
        margin-bottom: 10px;
        font-size: 0.9rem;
        padding: 10px;
    }
    
    /* QR Code menor em mobile */
    .area-participante .qr-code-container img {
        max-width: 200px !important;
        height: auto;
    }
    
    /* Alertas mais compactos */
    .area-participante .alert {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    /* Header do card menor */
    .area-participante .card-header h4 {
        font-size: 1.1rem;
    }
    
    /* Ajustar navbar */
    .area-participante .navbar-text {
        font-size: 0.85rem;
        display: block;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    /* Ajustes extras para telas muito pequenas */
    .area-participante .table {
        font-size: 0.75rem;
    }
    
    .area-participante .card-header h4 {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .area-participante .card-header .fas {
        font-size: 0.9rem;
    }
    
    /* Tabelas com layout de blocos */
    .area-participante .table-sm tr {
        display: block;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid #dee2e6;
        padding-bottom: 0.5rem;
    }
    
    .area-participante .table-sm td {
        display: block;
        width: 100% !important;
        border: none;
        padding: 0.25rem 0;
    }
    
    .area-participante .table-sm td:first-child {
        color: #666;
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }
    
    .area-participante .table-sm td:last-child {
        font-weight: 600;
        color: #000;
        font-size: 0.85rem;
    }
}

/* ========================================
   PREMIAÇÕES SECTION
======================================== */
.prizes-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.prizes-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.prizes-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 10px;
}

.prizes-title i {
    color: #ffd700;
    margin-right: 15px;
}

.prizes-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 50px;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.prize-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prize-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.prize-card-header {
    padding: 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.prize-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.prize-card-header.oficial {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.prize-card-header.sport {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.prize-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.prize-card-header h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    letter-spacing: 2px;
}

.prize-total {
    font-size: 1rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.prize-card-body {
    padding: 30px;
}

.prize-positions {
    margin-bottom: 30px;
}

.prize-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

.prize-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.prize-item.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-left-color: #ffd700;
    font-weight: 700;
}

.prize-item.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    border-left-color: #c0c0c0;
    font-weight: 600;
}

.prize-item.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a87c 100%);
    border-left-color: #cd7f32;
    font-weight: 600;
    color: white;
}

.prize-item .position {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.prize-item.bronze .position {
    color: white;
}

.prize-item .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #28a745;
}

.prize-item.gold .value,
.prize-item.silver .value {
    color: #2c3e50;
}

.prize-item.bronze .value {
    color: white;
}

.prize-categories {
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
}

.prize-categories h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease;
}

.sport .category-tag {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 10px rgba(240, 147, 251, 0.3);
}

.category-tag:hover {
    transform: scale(1.05);
}

.prize-note {
    background: white;
    border-left: 4px solid #17a2b8;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.prize-note i {
    font-size: 1.5rem;
    color: #17a2b8;
    flex-shrink: 0;
}

.prize-note p {
    margin: 0;
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .prizes-section {
        padding: 60px 0;
    }
    
    .prizes-title {
        font-size: 2rem;
    }
    
    .prizes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .prize-card-header {
        padding: 25px 20px;
    }
    
    .prize-card-body {
        padding: 20px;
    }
    
    .prize-item {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .prize-item .value {
        font-size: 1rem;
    }
    
    .category-tags {
        gap: 8px;
    }
    
    .category-tag {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .prize-note {
        flex-direction: column;
        text-align: center;
        padding: 15px 20px;
    }
}

@media (max-width: 576px) {
    .prizes-title {
        font-size: 1.6rem;
    }
    
    .prizes-subtitle {
        font-size: 0.95rem;
    }
    
    .prize-card-header h3 {
        font-size: 1.5rem;
    }
    
    .prize-total {
        font-size: 0.9rem;
        padding: 6px 15px;
    }
    
    .prize-icon {
        font-size: 2.5rem;
    }
}
