* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none; /* Previne seleção de texto */
}

body {
    background: #010a24 url('/static/fundo.png') center/cover no-repeat fixed;
    color: #e0d8f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body::before {
    display: none;
}

header {
    padding: 20px 40px;
    background: rgba(26, 11, 46, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(90deg, #009c3b, #f1c40f, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.container {
    display: flex;
    flex: 1;
    padding: 30px;
    gap: 30px;
    height: calc(100vh - 70px);
    min-height: 0;
    overflow: hidden;
}

.video-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    min-height: 0;
}

.video-container {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #000;
    border: 1px solid rgba(0, 86, 214, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.status-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.status-badge.show {
    opacity: 1;
    transform: translateY(0);
}

.status-badge.novo {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.5);
    box-shadow: 0 0 15px rgba(46, 213, 115, 0.3);
}

.status-badge.repetido {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.5);
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.3);
}

.history-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    min-height: 0;
}

.history-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #f1c40f;
    border-bottom: 1px solid rgba(241, 196, 15, 0.2);
    padding-bottom: 10px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
    min-height: 0;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(0, 86, 214, 0.3);
    border-radius: 10px;
}

.history-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.15);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s ease;
    animation: fadeIn 0.5s ease;
    cursor: pointer;
}

.history-item:hover {
    background: rgba(138, 43, 226, 0.1);
    transform: translateY(-2px);
    border-color: rgba(138, 43, 226, 0.4);
}

.history-item .time {
    font-size: 12px;
    color: #9a86b3;
    margin-bottom: 4px;
}

.history-item .link {
    font-size: 13px;
    color: #e0d8f0;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Efeito de flash na tela ao ler novo QR Code */
.flash-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(46, 213, 115, 0.2);
    pointer-events: none;
    opacity: 0;
    z-index: 10;
}

.flash-effect.active {
    animation: flashAnim 0.8s ease-out;
}

.flash-effect.error {
    background: rgba(255, 71, 87, 0.2);
    animation: flashAnim 0.8s ease-out;
}

@keyframes flashAnim {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Modal Detalhes */
.modal {
    display: none; 
    position: fixed; 
    z-index: 100; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.7); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: rgba(26, 11, 46, 0.95);
    border: 1px solid rgba(138, 43, 226, 0.4);
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.close-btn {
    color: #aaa;
    align-self: flex-end;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-top: -10px;
}

.close-btn:hover {
    color: #fff;
}

.modal-itens-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 10px;
    min-height: 0;
}

.modal-itens-list::-webkit-scrollbar {
    width: 6px;
}
.modal-itens-list::-webkit-scrollbar-thumb {
    background: rgba(0, 86, 214, 0.3);
    border-radius: 10px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 10px 0;
    font-size: 13px;
}

.item-row:last-child {
    border-bottom: none;
}

.item-name { flex: 2; padding-right: 10px; }
.item-qtd { flex: 1; text-align: center; color: #9a86b3; }
.item-price { flex: 1; text-align: right; color: #2ed573; font-weight: bold; }

/* O item do histórico agora é clicável e tem cursor pointer */
.history-item {
    cursor: pointer;
}

/* Remove tap highlight color on mobile */
* {
    -webkit-tap-highlight-color: transparent;
    user-select: none; /* prevent text selection on buttons */
}

.rendu-r { background: linear-gradient(to bottom right, #2ecc71 30%, #f1c40f 70%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; font-weight: 900; }


.rendu-r {
    background: linear-gradient(to bottom, currentColor 65%, #2ecc71 65%, #2ecc71 82%, #f1c40f 82%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    font-weight: 900;
}

.logo-dark { display: none; }
.logo-light { display: block; }

.dark-theme .logo-dark { display: block; }
.dark-theme .logo-light { display: none; }
