/* =========================================
   1. RESET & VARIABLE DASAR
========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* =========================================
   2. AUTHENTICATION (LOGIN & REGISTER)
========================================= */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.auth-container {
    background: #ffffff;
    padding: 35px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
}

.auth-container h2 {
    color: #0f172a;
    font-size: 1.6rem;
    margin-bottom: 20px;
    text-align: center;
}

/* =========================================
   3. NAVBAR MODERN
========================================= */
.navbar {
    background-color: #0f172a;
    color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #1e293b;
    color: #ffffff;
}

/* =========================================
   4. LAYOUT & CONTAINER DASHBOARD
========================================= */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.dashboard-header {
    margin-bottom: 25px;
}

.dashboard-header h2 {
    font-size: 1.75rem;
    color: #0f172a;
}

.card {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.card h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 15px;
}

/* =========================================
   5. WIDGET RINGKASAN STATISTIK (STAT CARDS)
========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.stat-card .stat-title {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 5px;
}

/* =========================================
   6. TABEL DATA ELEGAN
========================================= */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
}

.data-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* =========================================
   7. FORM & TOMBOL (BUTTONS)
========================================= */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.btn,
.btn:visited {
    display: inline-block;
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    color: #ffffff !important;
}

.btn-success,
.btn-success:visited { background-color: #10b981; color: white; }
.btn-success:hover { background-color: #059669; }

.btn-danger,
.btn-danger:visited { background-color: #ef4444; color: white; }
.btn-danger:hover { background-color: #dc2626; }

.btn-warning,
.btn-warning:visited { background-color: #f59e0b; color: white; }
.btn-warning:hover { background-color: #d97706; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

/* BADGES (PILL SHAPE) */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-warning { background-color: #fef3c7; color: #92400e; }

/* PESAN NOTIFIKASI */
.success { background-color: #dcfce7; color: #166534; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; }
.error { background-color: #fee2e2; color: #991b1b; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; }
.warning-box { background-color: #fffbebf8; border-left: 4px solid #f59e0b; color: #92400e; padding: 15px; border-radius: 6px; margin-bottom: 20px; }

/* =========================================
   8. KATALOG & GRID PRODUK (INDEX.PHP)
========================================= */

/* Form Pencarian & Filter */
.search-card {
    padding: 16px 20px;
}

.search-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-form input[type="text"] {
    flex: 2;
    min-width: 220px;
}

.search-form select {
    flex: 1;
    min-width: 160px;
}

/* System Grid Produk Simetris */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Kartu Produk (Product Card) */
.product-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Wadah & Pembatasan Ukuran Gambar Produk */
.product-image {
    position: relative;
    width: 100%;
    height: 190px;
    background-color: #f1f5f9;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Memotong gambar secara rapi & simetris tanpa merusak rasio */
    display: block;
}

.no-image {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.product-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

/* Informasi Produk */
.product-info {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-seller {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 12px;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 2px;
}

.product-stock {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 10px;
}

.product-desc {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 18px;
    flex-grow: 1;
    line-height: 1.5;
}

.product-action {
    margin-top: auto;
}

/* =========================================
   RESET WARNA LINK & VISITED (MENCEGAH WARNA UNGU)
========================================= */

/* 1. Reset Link Umum di Seluruh Aplikasi */
a {
    color: #10b981;
    text-decoration: none;
}

a:visited {
    color: #10b981; /* Mencegah warna ungu default browser saat link sudah pernah diklik */
}

a:hover {
    color: #059669;
}

/* 2. Reset Spesifik Semua Link di Dalam Navbar (Background Gelap) */
.navbar a,
.navbar a:visited {
    color: #cbd5e1; /* Warna abu-abu terang */
    text-decoration: none;
}

.navbar a:hover {
    color: #ffffff; /* Warna putih saat kursor di atas link */
}

/* 3. Class .nav-link Khusus Menu Navigasi */
.nav-link,
.nav-link:visited {
    color: #cbd5e1 !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #1e293b;
    color: #ffffff !important;
}

/* 4. Brand / Judul Aplikasi di Navbar */
.nav-brand a,
.nav-brand a:visited {
    color: #10b981 !important;
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-brand a:hover {
    color: #34d399 !important;
}

/* 5. Memastikan Teks Tombol (btn) di Navbar Tetap Putih */
.navbar .btn,
.navbar .btn:visited {
    color: #ffffff !important;
}

/* =========================================
   PERBAIKAN TEKS TOMBOL KATALOG PRODUK (INDEX.PHP)
========================================= */

/* Memaksa semua tombol/link aksi di dalam kartu produk berwarna putih */
.product-card .btn,
.product-card .btn:visited,
.product-action .btn,
.product-action .btn:visited,
.product-action a,
.product-action a:visited {
    color: #ffffff !important;
    background-color: #10b981;
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Efek Hover Tombol Kartu Produk */
.product-card .btn:hover,
.product-action .btn:hover,
.product-action a:hover {
    background-color: #059669;
    color: #ffffff !important;
}