:root {
    --primary-color: #d0021b;
    --bg-color: #050a15;
    --text-color: #f8fafc;
    --card-bg: rgba(20, 30, 48, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --font-family: 'Inter', system-ui, sans-serif;
    --nav-height: 70px;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(208, 2, 27, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(208, 2, 27, 0.1), transparent 25%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s, transform 0.2s;
}

/* Header */
.main-header {
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(5, 10, 21, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    display: flex;
    flex-direction: column;
}
.logo span:first-child { color: var(--text-color); }
.logo span:last-child { color: var(--primary-color); }
.logo small { font-size: 0.7rem; color: #94a3b8; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-top: -2px; }

/* Desktop Navbar */
.navbar .menu-links {
    display: flex;
    gap: 15px;
    align-items: center;
}
.nav-link {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s;
}
.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--primary-color);
}
.btn-primary {
    background: var(--primary-color);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(208, 2, 27, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(208, 2, 27, 0.6);
}

/* Mobile Bottom Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(10, 15, 30, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}
.m-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 4px;
    flex: 1;
}
.m-nav-item i { font-size: 1.2rem; }
.m-nav-item.active { color: var(--primary-color); }

/* Hero Section */
.hero-section {
    padding: 60px 0;
    text-align: center;
    animation: fadeUp 0.8s ease forwards;
}
.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-subtitle {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto 40px;
    font-weight: 400;
}

/* Cards Grid */
.lista-apostilas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0;
    margin: 30px 0;
}
.item-apostila {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}
.item-apostila:hover {
    transform: translateY(-5px);
}
.item-apostila img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.item-conteudo {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.item-conteudo h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}
.preco-lista {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 12px;
}
.item-conteudo p {
    color: #94a3b8;
    font-size: 0.9rem;
    flex: 1;
    margin: 0 0 20px 0;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* SPA View Container */
#app-root {
    min-height: 60vh;
    padding-bottom: 80px; /* space for mobile nav */
}

/* Responsive */
@media (max-width: 768px) {
    .navbar { display: none; } /* Hide desktop nav */
    .mobile-nav { display: block; } /* Show mobile nav */
    .hero-section { padding: 40px 0; }
    #app-root { padding-bottom: calc(var(--nav-height) + 20px); }
}
