:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --primary-color: #E50914;
    --card-bg: #111;
    --hover-bg: #1a1a1a;
    --secondary-text: #b3b3b3;
    --border-color: #333;
    --success-color: #2ecc71;
    --vip-color: #00b4d8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: 80px; /* Espaço para nav inferior */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER */
header {
    background-color: rgba(0,0,0,0.9);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #222;
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.menu-btn .bar {
    width: 22px;
    height: 2px;
    background-color: white;
    border-radius: 2px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.vip-badge-header {
    background: linear-gradient(135deg, var(--vip-color), #0077b6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* MENU LATERAL */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: #0a0a0a;
    z-index: 200;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-shadow: 2px 0 20px rgba(0,0,0,0.8);
    border-right: 1px solid #222;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #222;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li a {
    display: block;
    padding: 12px 10px;
    color: #999;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-radius: 6px;
}

.sidebar-list li a.active, .sidebar-list li a:hover {
    color: white;
    background: rgba(255,255,255,0.05);
    padding-left: 15px;
}

.sidebar-divider {
    height: 1px;
    background: #222;
    margin: 15px 0;
}

/* Subcategorias no Sidebar */
.cat-item {
    position: relative;
}

.cat-link {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.cat-toggle {
    font-size: 0.7rem;
    color: #666;
    transition: transform 0.2s;
    padding: 5px;
}

.cat-toggle.rotated {
    transform: rotate(180deg);
}

.subcat-list {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 10px;
}

.subcat-list.open {
    max-height: 500px;
}

.subcat-list li a {
    font-size: 0.85rem !important;
    color: #777 !important;
    padding: 8px 10px !important;
}

.subcat-list li a:hover {
    color: #bbb !important;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

body.menu-open .sidebar { left: 0; }
body.menu-open .sidebar-overlay { opacity: 1; visibility: visible; }

/* NAVEGAÇÃO INFERIOR */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to top, rgba(0,0,0,0.98), rgba(0,0,0,0.95));
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    border-top: 1px solid #222;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 0.7rem;
    padding: 8px 15px;
    border-radius: 12px;
    transition: all 0.2s;
    gap: 4px;
}

.nav-item.active {
    color: var(--vip-color);
}

.nav-item:hover {
    color: #aaa;
}

.nav-icon {
    width: 24px;
    height: 24px;
}

.nav-item.active .nav-icon {
    color: var(--vip-color);
}

/* CONTAINER */
.container {
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

.page-title {
    margin: 10px 0 20px 0;
    font-size: 1.3rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ABAS DE FILTRO */
.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 15px;
    scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tabs .tab {
    flex-shrink: 0;
    padding: 10px 20px;
    background: #151515;
    border: 1px solid #333;
    border-radius: 25px;
    color: #999;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-tabs .tab:hover {
    background: #222;
    color: white;
}

.filter-tabs .tab.active {
    background: var(--vip-color);
    border-color: var(--vip-color);
    color: white;
}

/* CATEGORIAS POPULARES (SCROLL HORIZONTAL) */
.popular-categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0 20px 0;
    scrollbar-width: none;
}

.popular-categories::-webkit-scrollbar {
    display: none;
}

.popular-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 6px;
}

.popular-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff;
    transition: all 0.2s;
}

.popular-item:hover .popular-icon {
    border-color: var(--vip-color);
    transform: scale(1.05);
}

.popular-name {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* GRID DE CATEGORIAS POPULARES (PÁGINA MAIS USADAS) */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.popular-card {
    background: linear-gradient(135deg, #151515, #1a1a1a);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.popular-card:hover {
    border-color: var(--vip-color);
    transform: translateY(-2px);
}

.popular-card-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--vip-color), #0077b6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.popular-card h3 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.popular-count {
    color: #666;
    font-size: 0.8rem;
}

/* GRID DE FIGURINHAS - 2 COLUNAS MOBILE */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .sticker-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* STICKER CARD */
.sticker-card {
    background-color: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.sticker-card:hover {
    border-color: #444;
    transform: translateY(-2px);
}

.sticker-card img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: transform 0.2s, filter 0.2s;
}

.sticker-card:active img {
    transform: scale(0.9);
}

/* BLOQUEIO VIP */
.sticker-card.locked img,
.hero-card.locked img {
    filter: blur(8px) grayscale(0.5);
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.lock-icon {
    font-size: 2rem;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.btn-hero-copy.locked {
    background: #333;
    color: #888;
}

/* BADGE PREMIUM */
.premium-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.8rem;
    z-index: 3;
}

/* BOTÃO FAVORITO */
.fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s;
    z-index: 4;
}

.fav-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.fav-btn.active {
    opacity: 1;
    background: rgba(229, 9, 20, 0.3);
}

/* LOADER */
.loader {
    display: none;
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    position: absolute;
    z-index: 1;
}

.sticker-card.loading { background: #111; }
.sticker-card.loading .loader { display: block; }
.sticker-card.loading img { opacity: 0; }

@keyframes spin { to { transform: rotate(360deg); } }

/* HERO SECTION */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.hero-card {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    background: #111;
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.2);
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

.btn-hero-copy {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 0;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
    max-width: 280px;
}

/* TOAST */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #222;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 300;
    left: 50%;
    bottom: 90px; /* Acima da nav inferior */
    transform: translateX(-50%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein { from {bottom: 60px; opacity: 0;} to {bottom: 90px; opacity: 1;} }
@keyframes fadeout { from {bottom: 90px; opacity: 1;} to {bottom: 60px; opacity: 0;} }

/* --- ADMIN UI COMPONENTS --- */

.admin-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Inputs Modernos */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: #151515;
    border: 1px solid #333;
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
    background: #1a1a1a;
}

/* Botões Modernos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, filter 0.2s;
    font-size: 1rem;
}

.btn:hover {
    filter: brightness(1.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #333;
    color: #ddd;
}

.btn-secondary:hover {
    background: #444;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #dc3545;
}

.btn-success {
    background: var(--success-color);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.dash-card {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 30px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dash-card:hover {
    transform: translateY(-5px);
    border-color: #444;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #151515;
}

.dash-card .icon-bg {
    font-size: 4rem;
    position: absolute;
    right: -10px;
    bottom: -10px;
    opacity: 0.05;
    transition: transform 0.3s;
}

.dash-card:hover .icon-bg {
    transform: scale(1.2) rotate(-10deg);
    opacity: 0.1;
}

.dash-card h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.dash-card p {
    color: #888;
    font-size: 0.9rem;
}

.dash-btn-arrow {
    margin-top: 20px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Tabela de Categorias */
.table-container {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #222;
}

.admin-table th {
    background: #1a1a1a;
    color: #888;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #161616;
}

/* Upload Drag Zone V2 */
.upload-zone {
    border: 2px dashed #333;
    background: #0d0d0d;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(229, 9, 20, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: #444;
    margin-bottom: 15px;
    transition: color 0.2s;
}

.upload-zone:hover .upload-icon {
    color: var(--primary-color);
}

.upload-text {
    color: #ccc;
    font-size: 1.1rem;
    font-weight: 500;
}

.upload-subtext {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Upload Queue List */
.queue-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.queue-item {
    background: #151515;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #222;
}

.queue-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #000;
}

.queue-info {
    flex: 1;
    min-width: 0;
}

.queue-name {
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd;
}

.queue-status {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* VIP LIST ADMIN */
.vip-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vip-item {
    background: #151515;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vip-item.inactive {
    opacity: 0.5;
}

.vip-email {
    font-weight: 500;
}

.vip-date {
    color: #666;
    font-size: 0.8rem;
}

.vip-actions {
    display: flex;
    gap: 8px;
}

.vip-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.vip-status.active {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success-color);
}

.vip-status.inactive {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Grid legado de 3 colunas (admin) */
.sticker-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (min-width: 768px) {
    .sticker-grid-3col {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .admin-container > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
