/* 
 * EDUCSTORE - DESIGN SYSTEM BASE (CSS)
 * Feito com foco em UI/UX moderna (Sombras suaves, Fontes Limpas)
 */

 :root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --accent: #F59E0B;
    --bg: #F9FAFB;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--primary-hover);
}

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

/* ====================
   HEADER & NAVBAR
   ==================== */
.main-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}
.logo span {
    color: var(--primary);
}

.search-bar form {
    display: flex;
    background: var(--bg);
    border-radius: 99px;
    padding: 4px;
    border: 1px solid var(--border);
    width: 450px;
    transition: box-shadow 0.2s;
}
.search-bar form:focus-within {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    border-color: var(--primary);
}
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 16px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
}
.search-bar button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 99px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.search-bar button:active {
    transform: scale(0.95);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.cart-icon {
    font-size: 1.3rem;
    position: relative;
    color: var(--text-main);
}
.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

.btn-primary {
    background: var(--text-main);
    color: white !important;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ====================
   HERO SECTION
   ==================== */
.hero-section {
    background: linear-gradient(135deg, #2E1065 0%, #4F46E5 100%);
    color: white;
    padding: 100px 20px;
    text-align: center;
}
.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -1px;
}
.hero-content h1 span {
    color: #34D399; /* Verde esmeralda claro pra contraste */
}
.hero-content p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 650px;
    margin: 0 auto 35px auto;
}
.btn-hero {
    display: inline-block;
    background: white;
    color: var(--primary) !important;
    padding: 16px 36px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 99px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

/* ====================
   PRODUCT GRID
   ==================== */
.recent-products {
    padding: 80px 20px;
}
.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.product-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.4;
}
.creator {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.rating {
    font-size: 0.9rem;
    margin-bottom: auto;
}
.rating span {
    color: var(--text-muted);
}
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}
.btn-buy {
    background: #E0E7FF;
    color: var(--primary);
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-buy:hover {
    background: var(--primary);
    color: white;
}

/* ====================
   FOOTER
   ==================== */
.main-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 80px 20px 30px 20px;
    margin-top: 40px;
}
.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}
.footer-col h4 {
    margin-bottom: 24px;
    font-size: 1.1rem;
    font-weight: 700;
}
.footer-col p {
    color: var(--text-muted);
    line-height: 1.6;
}
.footer-col a {
    display: block;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.footer-col a:hover {
    color: var(--primary);
}
.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ====================
   MOBILE RESPONSIVENESS
   ==================== */
@media (max-width: 768px) {
    /* Header */
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    .search-bar form {
        width: 100%;
        max-width: 100%;
    }
    
    /* Hero */
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    
    /* Grids & Dashboard */
    .container {
        padding: 0 15px;
    }
    .product-grid, .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Dashboard panel: force stacking on mobile */
    .container[style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }
    .container[style*="display: flex"] {
        flex-direction: column !important;
    }
    aside {
        width: 100% !important;
        margin-bottom: 20px;
    }
    
    /* Stat cards grid (1fr 1fr 1fr) -> single column */
    div[style*="grid-template-columns: 1fr 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Tables: scroll horizontally */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Product card grid in panel */
    div[style*="minmax(280px, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Padding adjustments */
    .container[style*="padding: 40px 20px"] {
        padding: 20px 15px !important;
    }
    .container[style*="padding: 0 20px 40px 20px"] {
        padding: 0 15px 20px 15px !important;
    }
    
    /* Sidebar inline padding */
    aside[style*="padding: 20px"] {
        padding: 15px !important;
    }
    
    /* Inline style spacing fixes */
    div[style*="gap: 30px"] {
        gap: 15px !important;
    }
    div[style*="gap: 20px"] {
        gap: 15px !important;
    }
    
    /* Keep sidebar links readable */
    aside a {
        font-size: 0.85rem;
        padding: 10px 12px !important;
    }
}
