
/* --- 1. CORE VARIABLES & RESET --- */
:root {
    --primary-color: #232f3e;    /* Deep Navy */
    --accent-color: #ff9900;     /* Amazon Orange */
    --text-dark: #111111;
    --text-light: #565959;
    --bg-light: #f0f2f2;
    --white: #ffffff;
    --error: #ba000d;
    --link-teal: #007185;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    background-color: var(--bg-light); 
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    width: 100%;
}

/* --- 2. HEADER & NAVIGATION --- */
.main-header { 
    background: var(--primary-color); 
    padding: 15px 0; 
    color: white;
}

.main-header .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo a { 
    color: white; 
    text-decoration: none; 
    font-size: 1.5rem; 
    font-weight: 800; 
    letter-spacing: -1px;
}

.logo span { color: var(--accent-color); }

nav ul { display: flex; list-style: none; gap: 20px; }
nav a { text-decoration: none; color: white; font-weight: 600; font-size: 0.95rem; }
nav a:hover { color: var(--accent-color); }

.user-actions { display: flex; align-items: center; gap: 15px; }
.user-greeting { font-size: 0.9rem; color: #fff; }
.user-greeting strong { color: var(--accent-color); }

.btn-logout, .login-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); }

/* --- 3. HERO & SECTIONS --- */
.hero {
    background: linear-gradient(rgba(35, 47, 62, 0.8), rgba(35, 47, 62, 0.8)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 { font-size: 3rem; margin-bottom: 10px; }
.hero p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 30px; }

.section-title { 
    margin-bottom: 30px; 
    font-size: 1.8rem; 
    border-bottom: 2px solid var(--accent-color); 
    display: inline-block; 
    padding-bottom: 5px; 
}

/* --- 4. CATEGORY CARDS --- */
.categories-section { padding: 40px 0; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.icon-placeholder {
    width: 60px; height: 60px;
    background: var(--bg-light);
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    margin-bottom: 15px;
}

/* --- 5. PRODUCT GRID --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.product-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: 0.3s;
}

.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.product-image img { width: 100%; height: 250px; object-fit: cover; }
.product-info { padding: 20px; }
.product-info h3 { font-size: 1.1rem; margin-bottom: 10px; }
.product-info .price { color: var(--error); font-weight: 700; font-size: 1.2rem; }

.btn-view, .btn-primary {
    display: inline-block;
    text-align: center;
    /* Use your variable, or #FF9900 for a classic Amazon orange */
    background: var(--accent-color, #FF9900); 
    color: var(--text-dark, #111);
    
    /* 1. Remove the black border */
    border: none; 
    
    /* 2. Styling refinements */
    text-decoration: none;
    padding: 12px 28px;      /* Slightly more breathing room */
    border-radius: 8px;      /* Softer, more modern corners */
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;         /* Makes it feel clickable */
    
    /* 3. Add depth and smoothness */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* 4. The "Look Better" Hover State */
.btn-view:hover, .btn-primary:hover {
    background: #e68a00;    /* A slightly darker orange on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px); /* Subtle lift effect */
}

/* 5. Click effect */
.btn-view:active, .btn-primary:active {
    transform: translateY(0px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* --- 6. AUTH & FORMS --- */
.auth-wrapper { display: flex; justify-content: center; padding: 60px 20px; }
.auth-card { background: white; width: 100%; max-width: 400px; padding: 30px; border-radius: 8px; border: 1px solid #ddd; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
.form-group input { width: 100%; padding: 10px; border: 1px solid #888; border-radius: 4px; }
.btn-submit { width: 100%; background: var(--accent-color); border: none; padding: 12px; font-weight: 700; cursor: pointer; border-radius: 4px; }

/* --- 7. ADMIN & FOOTER --- */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; }

footer { 
    background: var(--primary-color); 
    color: white; 
    padding: 40px 0; 
    margin-top: auto; 
    text-align: center;
}

/* FORCE GRID BEHAVIOR */
.category-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
}

.category-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 180px;
    background: #ffffff !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-header {
    margin-bottom: 40px;
    padding: 20px 0;
}

.category-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 0;
    color: var(--text-light);
    font-style: italic;
}

.content-area {
    padding: 40px 0;
    min-height: 60vh;
}

.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stat-card h4 {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* Table Styling */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th {
    text-align: left;
    background: #f8f9fa;
    padding: 12px;
    border-bottom: 2px solid #eee;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.btn-edit { color: #007bff; text-decoration: none; font-weight: 600; margin-right: 10px; }
.btn-delete { color: var(--error); text-decoration: none; font-weight: 600; }