@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA;
    --secondary-color: #10B981; /* Emerald 500 */
    --bg-color: #F3F4F6; /* Gray 100 */
    --surface-color: #FFFFFF;
    --text-main: #111827; /* Gray 900 */
    --text-muted: #6B7280; /* Gray 500 */
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Auth Layout (Login / Register) */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f6f8fc 0%, #e9edf5 100%);
}

.auth-card {
    background-color: var(--surface-color);
    width: 100%;
    max-width: 450px;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background-color: #F9FAFB;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: #FFFFFF;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.navbar {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    text-decoration: none;
}

.nav-brand img {
    height: 40px;
    border-radius: 6px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-greeting {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.btn-logout {
    color: #EF4444;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.btn-logout:hover {
    background-color: #FEE2E2;
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 2rem 0;
}

.banner-container {
    width: 100%;
    height: 200px;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
}

.banner-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
}

.banner-text {
    color: white;
}

.banner-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

/* ── Hamburger Menu ─────────────────────────────────────── */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background .2s;
}
.nav-hamburger:hover { background: rgba(0,0,0,.06); }
.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Tablet (≤ 768px) ───────────────────────────────────── */
@media (max-width: 768px) {
    /* Navbar */
    .nav-hamburger { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--surface-color);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.5rem;
        gap: 1rem;
        z-index: 100;
    }
    .nav-links.open { display: flex; }
    .navbar { position: relative; }
    .navbar .container { flex-wrap: wrap; }

    /* Dashboard grid */
    .dashboard-grid { grid-template-columns: 1fr; }

    /* Products grid */
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

    /* Banner */
    .banner-text h1 { font-size: 1.4rem; }
    .banner-container { height: 160px; }

    /* Auth card */
    .auth-card { padding: 2rem 1.5rem; }

    /* Form row: empilha */
    .form-row { flex-direction: column; gap: 0; }

    /* Social grid: 1 coluna */
    .social-grid { grid-template-columns: 1fr !important; }
}

/* ── Mobile (≤ 480px) ───────────────────────────────────── */
@media (max-width: 480px) {
    .container { padding: 0 .75rem; }

    /* Auth */
    .auth-card { padding: 1.5rem 1rem; border-radius: .75rem; }
    .auth-title { font-size: 1.25rem; }

    /* Navbar brand */
    .nav-brand { font-size: 1rem; }
    .nav-brand img { height: 32px; }

    /* Dashboard */
    .banner-container { height: 120px; border-radius: .75rem; }
    .banner-text h1 { font-size: 1.1rem; }
    .banner-text p { font-size: .8rem; }
    .banner-overlay { padding: 1rem; }
    .card { padding: 1rem; }
    .dashboard-content { padding: 1rem 0; }

    /* Products */
    .products-grid { grid-template-columns: 1fr; gap: 1rem; }
    .product-img { height: 150px; }

    /* Table: scroll horizontal */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Buttons */
    .btn { padding: .65rem 1rem; font-size: .85rem; }

    /* Form */
    .form-control { font-size: 1rem; } /* evita zoom no iOS */
    .social-grid { grid-template-columns: 1fr !important; }
}

.card {
    background: var(--surface-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Products Grid (Replaces Table) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-img {
    height: 180px;
    background-color: #F9FAFB;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-float {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-pricing {
    margin-bottom: 1.25rem;
    flex: 1;
}

.price-old {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.price-new {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Drag & Drop Zone */
.image-upload-wrapper {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
    background-color: #F9FAFB;
    transition: all 0.2s ease;
    position: relative;
}

.image-upload-wrapper.drag-active {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.drop-zone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn-upload {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-main);
    transition: background 0.2s;
}

.btn-upload:hover {
    background-color: #F3F4F6;
}

/* Form layout utils */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .half {
    flex: 1;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}


.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-platform {
    background-color: #E0E7FF;
    color: #4338CA;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #F87171;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #34D399;
}
