/* CSS Variables */
:root {
    --primary-color: #27ae60;
    --primary-dark: #1e8449;
    --primary-light: #2ecc71;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
}

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

body {
    font-family: "Poppins", sans-serif;
    background: #f5f7fa;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(135deg, #41a67e 0%, #27ae60 100%);
    padding: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar-logo i {
    font-size: 32px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.header-title p {
    color: #7f8c8d;
    margin: 0;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.notification-btn,
.profile-btn {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.notification-btn {
    background: #e8f5e9;
    color: #27ae60;
}

.notification-btn:hover {
    background: #27ae60;
    color: white;
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 700;
}

.profile-btn {
    background: #3498db;
    color: white;
    font-weight: 600;
}

.profile-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

/* Search & Filter Section */
.search-filter-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: #27ae60;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.search-bar button {
    position: absolute;
    right: 8px;
    top: 8px;
    padding: 8px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-bar button:hover {
    background: #229954;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 200px;
}

.filter-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.filter-item select,
.filter-item input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-item select:focus,
.filter-item input:focus {
    border-color: #27ae60;
    outline: none;
}

/* Category Navbar */
.category-navbar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Grid Layout */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Card */
.category-card {
    position: relative;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.category-card:hover img {
    transform: scale(1.1);
    filter: blur(3px) brightness(0.7);
}

/* Overlay default */
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0.6)
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

/* ======== W A R N A   H O V E R   B E R D A S A R K A N   K A T E G O R I ======== */

/* Tanaman Hias → Merah */
.category-card.cat-hias:hover .category-overlay {
    background: linear-gradient(
        to bottom,
        rgba(231, 76, 60, 0.7),
        rgba(192, 57, 43, 0.9)
    );
}

/* Buah-Buahan → Kuning */
.category-card.cat-buah:hover .category-overlay {
    background: linear-gradient(
        to bottom,
        rgba(241, 196, 15, 0.7),
        rgba(243, 156, 18, 0.9)
    );
}

/* Sayuran → Hijau (Default) */
.category-card.cat-sayur:hover .category-overlay {
    background: linear-gradient(
        to bottom,
        rgba(46, 204, 113, 0.7),
        rgba(39, 174, 96, 0.9)
    );
}

/* Lainnya → Biru */
.category-card.cat-lainnya:hover .category-overlay {
    background: linear-gradient(
        to bottom,
        rgba(52, 152, 219, 0.7),
        rgba(41, 128, 185, 0.9)
    );
}

/* Text */
.category-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Products Section */
.products-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #27ae60;
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-carousel {
    width: 100%;
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    background: #27ae60;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 10px;
}

.product-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 14px;
}

.product-seller i {
    color: #3498db;
}

.product-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-stock {
    font-size: 13px;
    color: #7f8c8d;
}

.product-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #7f8c8d;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-logo span {
        display: none;
    }

    .sidebar-menu a span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
    }

    .filter-row {
        flex-direction: column;
    }

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

.pagination-wrapper .btn {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
}

.pagination-wrapper .btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination-wrapper .btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
}

.pagination-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
}

.profile-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.profile-dropdown {
    position: relative;
}

.profile-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.profile-avatars {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #41A67E;
}

.dropdown-menu {
    position: absolute;
    top: 48px;
    right: 0;
    background: #fff;
    width: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    padding: 10px 0;
    display: none;
    z-index: 999;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f6f6f6;
}

.dropdown-item i {
    font-size: 16px;
}

.text-danger {
    color: #d9534f !important;
}
