/* style.css */
:root {
    --theme-main: #014C3F;
    --theme-dark: #003027;
    --bg-start: #07C853;
    --bg-end: #B1E901;
    --panini-light: #e6ecf5;
    --has-green: #28a745;
    --has-green-hover: #218838;
    --nav-text: #ffffff;
}

[data-theme="2022"] {
    --theme-main: #C4C6BB;
    --bg-start: #420C1A;
    --bg-end: #861E37;
    --nav-text: #000000;
}

[data-theme="2018"] {
    --theme-main: #D5B970;
    --bg-start: #002C7F;
    --bg-end: #0081D4;
    --nav-text: #000000;
}

[data-theme="2014"] {
    --theme-main: #013473;
    --bg-start: #12BCBC;
    --bg-end: #C2FCFD;
}

[data-theme="2010"] {
    --theme-main: #F7EB95;
    --bg-start: #E43810;
    --bg-end: #FE8723;
    --nav-text: #000000;
}

[data-theme="2006"] {
    --theme-main: #72AEB2;
    --bg-start: #17292C;
    --bg-end: #006A8D;
    --nav-text: #000000;
}

body {
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-top: 100px; /* for fixed navbar */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background 0.5s ease;
}

/* Garantir que inputs sejam clicáveis/selecionáveis */
input, textarea, select, [contenteditable="true"] {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

.theme-bg {
    background-color: var(--theme-main);
    transition: background-color 0.5s ease;
}

.btn-nav-custom {
    color: inherit !important;
    border: 1px solid rgba(255,255,255,0.2);
    opacity: 0.9;
}

.navbar-light .btn-nav-custom {
    border-color: rgba(0,0,0,0.2);
}

.navbar-text-custom {
    color: inherit !important;
    opacity: 0.9;
}

.navbar .navbar-brand,
.navbar .navbar-text-custom,
.navbar .btn-nav-custom {
    color: var(--nav-text) !important;
}

.btn-nav-custom:hover {
    opacity: 1;
    background-color: rgba(255,255,255,0.15);
}

.navbar-light .btn-nav-custom:hover {
    background-color: rgba(0,0,0,0.08);
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Stat Cards */
.stat-card {
    border: none !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.95) !important;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-title {
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-container-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

/* Stickers Buttons */
.btn-sticker {
    background-color: #ffffff;
    border: 2px solid #dee2e6;
    color: #495057;
    font-weight: bold;
    border-radius: 8px;
    padding: 10px 5px;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-sticker:active {
    transform: scale(0.95);
}

.btn-sticker.has {
    background-color: var(--has-green);
    border-color: var(--has-green-hover);
    color: white;
    box-shadow: 0 3px 6px rgba(40, 167, 69, 0.3);
}

/* Raridades Legends */
.btn-sticker.rarity-reg.has { background-color: #B666D2 !important; border-color: #9B44B9 !important; box-shadow: 0 3px 6px rgba(182, 102, 210, 0.4); }
.btn-sticker.rarity-brz.has { background-color: #CD7F32 !important; border-color: #A0522D !important; box-shadow: 0 3px 6px rgba(205, 127, 50, 0.4); }
.btn-sticker.rarity-prt.has { background-color: #C0C0C0 !important; border-color: #A9A9A9 !important; box-shadow: 0 3px 6px rgba(192, 192, 192, 0.4); color: #333 !important; }
.btn-sticker.rarity-oro.has { background-color: #FFD700 !important; border-color: #DAA520 !important; box-shadow: 0 3px 6px rgba(255, 215, 0, 0.4); color: #333 !important; }

.repeated-badge {
    font-size: 0.7rem;
    padding: 0.35em 0.5em;
    border: 2px solid white;
}

/* Filters */
.btn-group .btn {
    font-weight: 500;
}

/* Sections Accordion */
.section-header {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(5px);
}

.section-header:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateX(5px);
}

.section-title {
    color: var(--theme-main);
    font-size: 1.1rem;
}

[data-theme="2026"] .section-header, 
[data-theme="2014"] .section-header {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #495057;
}

.section-container {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
}

.section-status-labels .badge {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Search */
#searchInput {
    border-radius: 20px;
    padding-left: 15px;
}

/* Custom Filter Button Effects */
#filter-group .btn {
    transition: all 0.3s ease;
    opacity: 0.85;
}

#filter-group .btn:hover {
    filter: brightness(1.2);
    opacity: 1;
    transform: translateY(-1px);
}

#filter-group .btn-check:checked + .btn {
    filter: brightness(1.25);
    opacity: 1;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    transform: scale(1.05);
    z-index: 2;
}

@media (max-width: 576px) {
    body {
        padding-top: 100px; /* Reduzindo um pouco para aproximar da barra sem colar */
    }
    .btn-sticker {
        font-size: 0.8rem;
        padding: 8px 2px;
    }
}

/* Floating Lock Button */
.lock-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white !important;
    cursor: pointer;
    z-index: 2000;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lock-btn.locked {
    background-color: #dc3545; /* Vermelho: Travado */
    border: 3px solid rgba(255,255,255,0.5);
}

.lock-btn.unlocked {
    background-color: #28a745; /* Verde: Aberto */
    border: 3px solid rgba(255,255,255,0.5);
    transform: scale(1.1);
}

.lock-btn:active {
    transform: scale(0.9);
}

/* Indicador visual de que está travado */
body.is-locked .btn-sticker {
    opacity: 0.85;
    cursor: default;
}

body.is-locked .btn-sticker:active {
    transform: none;
}

/* Estilos Tabela de Jogos */
.table-standings img {
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
    border: 1px solid rgba(0,0,0,0.05);
}

.match-card {
    transition: transform 0.2s;
}

.match-card:hover {
    transform: translateY(-2px);
}

/* Scanner Styles */
.scan-btn {
    position: fixed;
    bottom: 25px;
    right: 100px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white !important;
    cursor: pointer;
    z-index: 2000;
    background-color: var(--theme-main);
    border: 3px solid rgba(255,255,255,0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
}

.scan-btn:active {
    transform: scale(0.9);
}

.scan-btn:active {
    transform: scale(0.9);
}

#scannerModal .modal-content {
    background-color: #000;
    border: none;
    border-radius: 0;
}

#scannerModal .modal-body {
    padding: 0;
    position: relative;
    overflow: hidden;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scanner-frame {
    width: 250px;
    height: 150px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    position: relative;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
}

.scanner-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #00ff00;
    box-shadow: 0 0 15px #00ff00;
    opacity: 0;
}

.scanning .scanner-frame::before {
    opacity: 1;
    animation: scan-anim 2s linear infinite;
}

@keyframes scan-anim {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.scanner-tip {
    color: white;
    margin-top: 20px;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

.scanner-status {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    color: #00ff00;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,1);
    opacity: 0;
    transition: opacity 0.3s;
}

.scanner-status.active {
    opacity: 1;
}

.scanner-status.duplicate {
    color: #28a745 !important;
}

@media (max-width: 576px) {
    .scan-btn {
        bottom: 20px;
        right: 90px;
    }
    .lock-btn {
        bottom: 20px;
        right: 20px;
    }
}

/* --- Novos Estilos do Scanner (Modo Troca) --- */
#scannerModal .modal-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.scanner-view-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.scanner-controls-bar {
    background: var(--theme-main);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 10;
    width: 100% !important;
    box-sizing: border-box;
}

.scanner-results-area {
    background: #f8f9fa;
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: flex-start;
    min-height: 0;
}

#scanned-stickers-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-bottom: 20px;
    width: 100%;
}

.scanned-item {
    min-width: 0;
    background: white;
    border-radius: 10px;
    padding: 8px 4px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 2px solid #dee2e6;
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.scanned-item.has-sticker {
    border-color: #adb5bd;
    background: #f8f9fa;
    opacity: 0.8;
}

.scanned-item.missing-sticker {
    border-color: #28a745;
    background: #f0fff4;
}

.scanned-code {
    font-weight: 800;
    font-size: 0.8rem;
    color: #333;
    display: block;
    margin-bottom: 2px;
}

.scanned-status {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 4px;
    border-radius: 4px;
}

.status-has { background: #6c757d; color: white; }
.status-missing { background: #28a745; color: white; }

/* Custom Scrollbar para a lista de resultados */
.scanner-results-area::-webkit-scrollbar {
    width: 6px;
}
.scanner-results-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.scanner-results-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.scanner-results-area::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Estilo para a mensagem de lista vazia no scanner */
.empty-scanner-view {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.empty-scanner-view i {
    font-size: 3rem;
    color: #ced4da;
}

.empty-scanner-view p {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

