@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-deep: #020202;
    --bg-card: #121212;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent: #a78bfa;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --border: #27272a;        
    --radius: 16px;           
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body { 
    background-color: var(--bg-deep); 
    color: var(--text-main);
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* NAVBAR */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 5%;
    background: rgba(18, 18, 18, 0.8); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.logo { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo i { color: var(--primary); }

.search-bar { flex: 1; max-width: 500px; margin: 0 20px; position: relative; }
.search-bar input {
    width: 100%; padding: 12px 20px; padding-left: 45px;
    background: #000; border: 1px solid var(--border); border-radius: 50px; color: white; outline: none; transition: 0.3s;
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 15px rgba(139, 92, 246, 0.2); }
.search-bar i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.user-menu { display: flex; align-items: center; gap: 15px; }
.user-menu button { background: transparent; border: none; color: var(--text-main); font-size: 1.1rem; cursor: pointer; transition: 0.3s; }
.user-menu button:hover { color: var(--primary); transform: scale(1.1); }

/* BOTÃO TUTORIAL */
.btn-tutorial {
    background: rgba(139, 92, 246, 0.15); color: var(--primary);
    border: 1px solid var(--primary); padding: 8px 16px; border-radius: 50px;
    font-weight: 600; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; gap: 8px; font-size: 0.9rem;
}
.btn-tutorial:hover { background: var(--primary); color: white; box-shadow: 0 0 15px rgba(139, 92, 246, 0.4); transform: translateY(-2px); }

/* CATEGORIAS */
.container { padding: 2rem 5%; }
.section-title { 
    font-size: 1.2rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px;
    background: linear-gradient(90deg, #fff, #a1a1aa); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.cat-scroll-container { position: relative; width: 100%; margin-bottom: 3rem; }
.cat-scroll { 
    display: flex; gap: 15px; overflow-x: auto; padding: 10px 5px 20px 5px;
    scroll-behavior: smooth; -ms-overflow-style: none; scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-card {
    min-width: 110px; height: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border); border-radius: 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s; color: var(--text-muted); position: relative; overflow: hidden;
}
.cat-card:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-5px); border-color: rgba(139, 92, 246, 0.5); color: white; }
.cat-card.active {
    background: var(--primary); border-color: var(--primary); color: white;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4); transform: scale(1.05);
}
.cat-card i { font-size: 1.8rem; margin-bottom: 8px; transition: 0.3s; }
.cat-card.active i { transform: scale(1.2); }
.cat-card span { font-size: 0.85rem; font-weight: 500; }

/* GRID CURSOS */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.dream-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: 0.3s; display: flex; flex-direction: column;
}
.dream-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 0 20px rgba(139, 92, 246, 0.1); }
.card-img-top { height: 150px; width: 100%; object-fit: cover; mask-image: linear-gradient(to bottom, black 80%, transparent 100%); background: #111; }
.card-body { padding: 1.2rem; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.badge { 
    align-self: flex-start; background: rgba(139, 92, 246, 0.1); color: var(--accent); 
    padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; border: 1px solid rgba(139, 92, 246, 0.2);
}
.card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.card-price { color: var(--text-muted); font-size: 0.9rem; margin-bottom: auto; }
.price-highlight { color: #10b981; font-weight: bold; font-size: 1.1rem; }
.btn-buy {
    background: var(--primary); color: white; border: none; padding: 12px; width: 100%; border-radius: 10px;
    font-weight: 700; font-size: 0.95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.3s; margin-top: 15px; text-decoration: none;
}
.btn-buy:hover { background: var(--primary-hover); box-shadow: 0 0 15px var(--primary); }
.btn-delete { background: transparent; border: 1px solid #ef4444; color: #ef4444; width: 100%; padding: 8px; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.btn-delete:hover { background: #ef4444; color: white; }

/* PAGINAÇÃO */
.pagination-container { display: flex; justify-content: center; gap: 8px; margin-top: 3rem; padding-bottom: 2rem; }
.page-btn { width: 40px; height: 40px; border-radius: 8px; background: var(--surface-color); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* MODALS & AUTH */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); z-index: 200; }
.modal-content, .auth-box { background: #121212; padding: 2rem; border-radius: 16px; border: 1px solid var(--primary); width: 400px; max-width: 90%; }
.auth-container { height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at center, #1e1b4b 0%, #000 70%); }
.auth-input { width: 100%; padding: 12px; margin: 10px 0; background: #000; border: 1px solid var(--border); color: white; border-radius: 8px; }
.btn-purple { background: var(--primary); color: white; padding: 12px; width: 100%; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; }
.msg-box { background: var(--bg-card); padding: 2rem; border-radius: 20px; width: 320px; text-align: center; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: popIn 0.3s; }

/* --- AJUSTES MOBILE (MANTENDO O VISUAL ORIGINAL) --- */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; gap: 10px; padding: 1rem; }
    .search-bar { order: 3; width: 100%; margin: 5px 0 0 0; min-width: 100%; }
    .btn-tutorial span { display: none; } /* Ícone apenas no mobile */
    .user-menu { gap: 10px; }
    /* Mantém 2 colunas no celular (visual store) em vez de 1 */
    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; } 
    .container { padding: 1rem 3%; }
}