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

:root {
    --primary-color: #6366f1; /* Indigo 500 */
    --primary-hover: #4f46e5; /* Indigo 600 */
    --bg-color: #0f172a;      /* Slate 900 */
    --surface-color: #1e293b;  /* Slate 800 */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;   /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --accent-color: #10b981;   /* Emerald 500 for success/accents */
    --danger-color: #ef4444;   /* Red 500 */
    --border-radius: 20px;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

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

header {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#appLogo {
    height: 40px;
    width: auto;
    display: block;
    border-radius: 8px;
}

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

.nav-btn {
    background: none;
    border: 1px solid transparent;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem 1.25rem;
    border-radius: 12px;
    transition: var(--transition);
}

.nav-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.nav-btn:hover:not(.active) {
    color: var(--primary-color);
}

/* View Containers */
.view {
    padding: 2rem 0;
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fadeIn {
    animation: fadeIn 0.4s ease forwards;
}

/* Admin Styles */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .admin-grid {
        grid-template-columns: 350px 1fr;
    }
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

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

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

input, textarea {
    width: 100%;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background-color: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
}

/* Table / List Styles */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

.product-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.product-info {
    flex: 1;
}

.product-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.product-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Client Styles */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: scale(1.02) translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

.product-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.product-card-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 1.5rem;
}

.search-container input {
    width: 100%;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: white;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-container input:focus {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Category Filter Bar */
.category-filter-bar {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0 1.5rem 0;
    margin-bottom: 1rem;
    scrollbar-width: none; /* Firefox */
}

.category-filter-bar::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.cat-btn {
    white-space: nowrap;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.cat-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.cat-btn.active {
    background: white;
    color: black;
    border-color: white;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 15px;
    background: #000;
}

.carousel-slide {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-slide img {
    min-width: 100%;
    height: 100%;
    object-fit: contain;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.carousel-btn-prev { left: 1rem; }
.carousel-btn-next { right: 1rem; }

.seller-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.seller-tag:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Cart Floating Toggle */
.cart-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 1000;
    border: none;
    transition: var(--transition);
}

.cart-toggle svg {
    color: white;
}

.cart-toggle:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 2000;
    border-left: 1px solid var(--glass-border);
    transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
}

.cart-item img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.cart-item-info {
    flex: 1;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.control-btn {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    background-color: rgba(255, 255, 255, 0.02);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
    backdrop-filter: blur(4px);
}

.overlay.active {
    display: block;
}

/* WhatsApp Icon SVG */
.icon-whatsapp {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Login View Adjustments */
#viewLogin .card {
    margin-top: 5rem;
    padding: 3rem;
    border-color: rgba(255, 255, 255, 0.2);
}

#viewLogin h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

/* Footer Adjustments */
footer strong {
    color: white;
    font-weight: 700;
}

footer p {
    margin: 0.25rem 0;
}

/* Responsive Footer */
@media (max-width: 768px) {
    footer {
        margin-bottom: 6rem; /* Space for floating cart */
    }
}
