/* --- MODERN PROFESSIONAL VARIABLES --- */
:root {
    --primary-color: #25D366;
    --primary-dark: #128C7E;
    --secondary-dark: #075E54;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Mobile-First Design & Global Overhaul */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.app-container { 
    width: 100%; 
    max-width: 450px; 
    animation: fadeInUp 0.8s ease-out;
}

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

header { margin-bottom: 30px; text-align: center; }
header h1 { 
    color: var(--secondary-dark); 
    font-size: 2.5rem; 
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 0 15px rgba(37, 211, 102, 0.2);
}

.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px; /* Modern rounded corners */
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.input-group input,
input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"],
input[type="number"],
textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 16px;
    transition: var(--transition);
    outline: none;
    background: #fdfdfd;
}

/* THE GLOW EFFECT ON FOCUS */
input:focus, textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.3) !important;
    background: #fff;
    transform: translateY(-1px);
}

button {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(18, 140, 126, 0.4);
}

#toggle-text {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

#toggle-text strong {
    color: var(--primary-dark);
}

.badge-new { background: #ff9800; color: white; padding: 5px; border-radius: 5px; display: inline-block; font-size: 12px; margin-top: 5px; }
.warning-box { background: #fff3cd; color: #856404; padding: 10px; border-radius: 5px; font-size: 13px; margin: 15px 0; border: 1px solid #ffeeba; }

.grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.product-card { 
    background: white; 
    padding: 10px; 
    border-radius: 15px; 
    box-shadow: var(--shadow); 
    transition: var(--transition);
    border: 1px solid transparent;
}

.product-card:hover {
    transform: scale(1.03);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.product-card img { width: 100%; border-radius: 10px; height: 150px; object-fit: cover; }
.product-card h3 { font-size: 14px; margin: 10px 0 5px; color: var(--text-main); }
.price { color: var(--primary-color); font-weight: bold; }

.wa-link { 
    display: block; 
    text-decoration: none; 
    background: var(--primary-color); 
    color: white; 
    padding: 10px; 
    border-radius: 8px; 
    font-size: 12px; 
    margin-top: 10px; 
    text-align: center;
    font-weight: bold;
}

.report-btn { background: none; border: none; color: #e74c3c; text-decoration: underline; margin-top: 30px; font-size: 12px; cursor: pointer; }

/* --- SPINNER & LOADER --- */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #eee;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* UPDATED: AUTH LOADER OVERLAY */
#loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

/* --- BUTTON SPECIFICS --- */
.btn-edit { background-color: #3498db !important; font-size: 14px !important; padding: 8px !important; margin-bottom: 5px; }
.btn-delete { background-color: #e74c3c !important; font-size: 14px !important; padding: 8px !important; }

/* --- MODAL ANIMATION --- */
#product-modal .card {
    animation: slideUp 0.3s ease-out;
}

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

footer {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* --- DARK MODE OVERRIDES (NEW UPDATE) --- */
body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);
    --card-bg: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #b0b0b0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

body.dark-mode #loader {
    background: rgba(18, 18, 18, 0.9);
}

body.dark-mode .card {
    border: 1px solid #333;
}

body.dark-mode input, 
body.dark-mode textarea {
    background: #2d2d2d;
    border-color: #444;
    color: white;
}

body.dark-mode .product-card {
    background: #2d2d2d;
}

body.dark-mode header h1 {
    color: var(--primary-color);
}

/* --- UPDATED: SELECT DROPDOWN STYLES --- */
select {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 16px;
    transition: var(--transition);
    outline: none;
    background: #fdfdfd;
    cursor: pointer;
    appearance: none; /* Removes default arrow to allow for custom look */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
}

select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.3) !important;
}

body.dark-mode select {
    background-color: #2d2d2d;
    border-color: #444;
    color: white;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* --- NEW: FEATURED SECTION STYLING --- */
#featured-section h2 {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#featured-list .product-card {
    border: 2px solid #f1c40f; /* Gold border for featured items */
    background: linear-gradient(to bottom, #ffffff, #fffdf0);
}

body.dark-mode #featured-list .product-card {
    background: linear-gradient(to bottom, #2d2d2d, #332b00);
    border-color: #f1c40f;
}

#featured-list .product-card:hover {
    box-shadow: 0 15px 30px rgba(241, 196, 15, 0.2);
}
