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

:root {
    --primary-color: #296260;
    --primary-light: #3a7b79;
    --primary-dark: #1e4b49;
    --secondary-color: #e8f4f3;
    --accent-color: #ffd700;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --background: #f8fafa;
    --card-background: #ffffff;
    --border-color: #e1e8ed;
    --shadow: 0 4px 6px rgba(41, 98, 96, 0.1);
    --shadow-hover: 0 8px 25px rgba(41, 98, 96, 0.15);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--gradient);
    color: var(--text-light);
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Main */
.main {
    padding: 3rem 0;
}

.ranking-section {
    margin-bottom: 4rem;
    background: var(--card-background);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ranking-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Pódium */
.podium {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.podium-item {
    background: var(--card-background);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.podium-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

.podium-item.first {
    order: 2;
    transform: scale(1.1);
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: var(--text-dark);
}

.podium-item.first::before {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.podium-item.second {
    order: 1;
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
}

.podium-item.third {
    order: 3;
    background: linear-gradient(135deg, #cd7f32, #daa520);
}

.podium-position {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.podium-item.first .podium-position {
    color: #b8860b;
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.podium-item.first .podium-avatar {
    background: #b8860b;
}

.podium-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.podium-points {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.podium-item.first .podium-points {
    color: #b8860b;
}

.podium-branch {
    font-size: 0.9rem;
    opacity: 0.8;
    background: rgba(41, 98, 96, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

/* Tabs das filiais */
.branch-tabs {
    margin-top: 2rem;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-button {
    padding: 0.8rem 1.5rem;
    background: var(--secondary-color);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
}

.tab-button.active,
.tab-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.branch-ranking {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.branch-item {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.branch-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.branch-item.first {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.branch-item.second {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
}

.branch-item.third {
    background: linear-gradient(135deg, #cd7f32, #daa520);
}

.branch-position {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.branch-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.branch-points {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Busca e filtros */
.search-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(41, 98, 96, 0.1);
}

#branchFilter {
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

#branchFilter:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Tabela geral */
.ranking-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-header {
    display: grid;
    grid-template-columns: 80px 1fr 150px 120px 100px;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    font-weight: 600;
    gap: 1rem;
}

.table-body {
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 80px 1fr 150px 120px 100px;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    gap: 1rem;
    align-items: center;
}

.table-row:hover {
    background: var(--secondary-color);
}

.table-row:last-child {
    border-bottom: none;
}

.col-position {
    font-weight: 500;
}

.col-name {
    font-weight: 500;
}

.col-branch {
    font-weight: 500;
}

.col-points {
    font-weight: 500;
}

.col-valor {
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--primary-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .header-stats {
        justify-content: center;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-item {
        order: unset !important;
        transform: none !important;
        width: 100%;
        max-width: 300px;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .search-box {
        min-width: unset;
    }
    
    #branchFilter {
        min-width: unset;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 60px 1fr 100px 80px 80px;
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .col-branch {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
    
    .branch-ranking {
        grid-template-columns: 1fr;
    }
    
    .tab-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .tab-button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .col-valor {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .ranking-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 50px 1fr 80px 70px 70px;
        font-size: 0.8rem;
        padding: 0.8rem;
    }
    
    .stat {
        min-width: 100px;
        padding: 0.8rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .col-valor {
        white-space: nowrap;
    }
}

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

.ranking-section {
    animation: fadeInUp 0.6s ease-out;
}

.podium-item {
    animation: fadeInUp 0.6s ease-out;
}

.table-row {
    animation: fadeInUp 0.3s ease-out;
}