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

/*
  Logo + favicon placeholders:
  - Replace in js/app.js: BENUKU_LOGO_URL and BENUKU_FAVICON_URL (or their SVG templates)
*/

/* ==================== BENUKU THEME ====================
   Theme colors requested:
   Primary buttons: #4CAF50
   Hover state: #2E7D32
   Icons / Highlights: #8BC34A
   Accent badges: #FF9AA2
   Page background: #F4FFF4
   Text: #333333
*/
:root {
    --bn-primary: #4CAF50;
    --bn-primary-hover: #2E7D32;
    --bn-highlight: #8BC34A;
    --bn-accent: #FF9AA2;
    --bn-bg: #F4FFF4;
    --bn-text: #333333;
}

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bn-bg);
    color: var(--bn-text);
}

/* Benuku Logo image sizing (used across pages via JS injection) */
/* Compact, e‑commerce style (Daraz-like) while staying responsive */
.bn-logo-img {
    height: 32px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

@media (min-width: 768px) {
    .bn-logo-img {
        height: 40px;
    }
}

@media (min-width: 1024px) {
    .bn-logo-img {
        height: 44px;
    }
}

/* Store name text shown next to the placeholder logo icon */
.bn-logo-name {
    margin-left: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--bn-text);
    line-height: 1;
    font-size: 1.15rem;
}

@media (min-width: 768px) {
    .bn-logo-name {
        font-size: 1.3rem;
    }
}

/* Utility: Accent badge */
.badge-accent {
    background: var(--bn-accent);
    color: var(--bn-text);
}

/* ==================== THEME OVERRIDES FOR TAILWIND CLASSES ====================
   We override commonly used Tailwind utility classes in this project so
   the whole site adopts the Benuku green theme without rewriting every page.
*/

/* Page background helpers */
.bg-gray-50 { background-color: var(--bn-bg) !important; }

/* Primary buttons + surfaces */
.bg-indigo-600,
.bg-indigo-500 { background-color: var(--bn-primary) !important; }
.bg-indigo-700 { background-color: var(--bn-primary-hover) !important; }
.hover\:bg-indigo-700:hover { background-color: var(--bn-primary-hover) !important; }
.hover\:bg-indigo-600:hover { background-color: var(--bn-primary-hover) !important; }

/* Dark buttons used for secondary CTAs */
.bg-gray-900 { background-color: var(--bn-primary-hover) !important; }
.hover\:bg-black:hover { background-color: var(--bn-primary-hover) !important; }

/* Text highlights */
.text-indigo-600,
.text-indigo-500 { color: var(--bn-highlight) !important; }
.hover\:text-indigo-600:hover { color: var(--bn-highlight) !important; }

/* Focus rings / borders */
.focus\:ring-indigo-500:focus,
.focus\:ring-indigo-600:focus {
    --tw-ring-color: rgba(139, 195, 74, 0.6) !important;
}
.border-indigo-500,
.border-indigo-600 { border-color: var(--bn-highlight) !important; }

/* Soft highlight backgrounds */
.bg-indigo-100 { background-color: rgba(139, 195, 74, 0.18) !important; }
.bg-purple-50 { background-color: rgba(139, 195, 74, 0.12) !important; }

/* Featured badges previously yellow */
.bg-yellow-400 { background-color: var(--bn-accent) !important; color: var(--bn-text) !important; }

/* Gradient Text */
.gradient-text {
    background: linear-gradient(to right, var(--bn-primary), var(--bn-highlight));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cart Sidebar */
.cart-sidebar {
    transform: translateX(100%);
}

/* ==================== ELITECOMMERCE ADMIN DASHBOARD UI ==================== */

/* Compact layout toggle (Admin settings) */
body.ec-compact .ec-kpi {
    padding: 1rem;
}
body.ec-compact .ec-kpi-value {
    font-size: 1.6rem;
}
body.ec-compact .ec-btn {
    padding: 0.55rem 0.8rem;
}
body.ec-compact .ec-nav {
    padding: 0.6rem 0.8rem;
}

.ec-sidebar {
    background: linear-gradient(180deg, var(--bn-primary-hover), #1f2937);
}

.ec-nav {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.9rem;
    color: rgba(255,255,255,0.85);
    transition: background 0.2s ease, transform 0.2s ease;
}

.ec-nav i {
    width: 1.25rem;
    text-align: center;
    opacity: 0.95;
}

.ec-nav:hover {
    background: rgba(255,255,255,0.08);
}

.ec-nav.active {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.ec-nav-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem;
    border-radius: 0.9rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-weight: 600;
    font-size: 0.875rem;
}

.ec-nav-sm i {
    color: var(--bn-highlight);
}

.ec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.95rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.ec-btn:active {
    transform: translateY(1px);
}

.ec-btn-primary {
    background: var(--bn-primary);
    color: #fff;
}

.ec-btn-primary:hover {
    background: var(--bn-primary-hover);
}

.ec-btn-ghost {
    background: rgba(17,24,39,0.04);
    color: #111827;
    border-color: rgba(17,24,39,0.08);
}

.ec-btn-ghost:hover {
    background: rgba(17,24,39,0.08);
}

.ec-btn-danger {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.25);
    color: #b91c1c;
}

.ec-btn-danger:hover {
    background: rgba(239,68,68,0.18);
}

.ec-kpi {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 1.25rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.ec-kpi-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ec-kpi-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: #111827;
    margin-top: 0.2rem;
}

.ec-kpi-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1.1rem;
    background: rgba(139, 195, 74, 0.18);
    color: var(--bn-primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ec-view {
    display: none;
}

.ec-view.active {
    display: block;
}

.ec-pill {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.ec-pill-blue { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.ec-pill-purple { background: #e9d5ff; color: #7c3aed; border-color: #ddd6fe; }
.ec-pill-green { background: #d1fae5; color: #059669; border-color: #a7f3d0; }
.ec-pill-red { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

.cart-sidebar.open {
    transform: translateX(0);
}

/* Modal */
.modal {
    display: none;
}

.modal.active {
    display: flex;
}

/* Admin Panel */
.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

/* Store Front */
.store-front {
    display: block;
}

.store-front.hidden {
    display: none;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Auth Content */
.auth-content {
    display: none;
}

.auth-content.active {
    display: block;
}

/* Profile Content */
.profile-content {
    display: none;
}

.profile-content.active {
    display: block;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
}

.loading-overlay.active {
    display: flex;
}

/* Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--bn-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Product Card Hover Effects */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
}

.product-card .overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .overlay {
    opacity: 1;
}

.product-card img {
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.1);
}

/* Toast Animation */
.toast {
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.hide {
    transform: translateY(20px);
    opacity: 0;
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Button Hover Effects */
.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(76, 175, 80, 0.35);
}

/* Filter Button Active State */
.filter-btn.active {
    background-color: var(--bn-primary);
    color: white;
}

/* Admin Tab Active State */
.admin-tab.active {
    color: var(--bn-primary);
    border-bottom: 2px solid var(--bn-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Form Focus States */
input:focus, select:focus, textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: #6366f1;
}

/* Table Row Hover */
.admin-table tr:hover {
    background-color: #f9fafb;
}

/* Order Card */
.order-card {
    transition: all 0.2s ease;
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Brand word styling (inline "Benuku" text anywhere in content) */
.bn-brand-word {
    background: linear-gradient(to right, var(--bn-primary), var(--bn-highlight));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Status Badge Colors */
.status-pending {
    background-color: #fef3c7;
    color: #b45309;
}

.status-processing {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.status-shipped {
    background-color: #e9d5ff;
    color: #7c3aed;
}

.status-delivered {
    background-color: #d1fae5;
    color: #059669;
}

/* Category Badge Colors */
.category-electronics {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.category-fashion {
    background-color: #fce7f3;
    color: #db2777;
}

.category-home {
    background-color: #d1fae5;
    color: #059669;
}

.category-accessories {
    background-color: #fef3c7;
    color: #b45309;
}

/* ==================== MOBILE COMPACT TWEAKS ====================
   Goal: improve phone sizing without changing desktop. */

/* Slightly reduce overall scale on very small screens */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    /* Make header feel less tall on phones */
    header .max-w-7xl {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    /* Slightly smaller header icons on phones */
    header i.text-xl {
        font-size: 1.1rem !important;
        line-height: 1.5rem !important;
    }
}

/* Product page main image height (mobile-friendly) */
#product-main-image {
    height: 320px;
}

@media (min-width: 768px) {
    #product-main-image {
        height: 420px;
    }
}

/* Text clamping (prevents long titles from stretching cards) */
.clamp-1,
.clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
