/* =========================================
   ECOSORT/OURDAPUR UI COMPONENTS
   ========================================= */

/* --- 1. BUTTONS --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-color);
    color: var(--gray-900); /* keep text dark/black on hover */
    border-color: var(--primary-color);
}

/* --- 2. CARDS --- */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* --- 3. FORMS & INPUTS --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: border-color 0.2s;
    background-color: var(--gray-50);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
}

/* --- 4. BADGES & TAGS --- */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}
/* =========================================
   OURDAPUR COMPONENT LIBRARY
   Matches "My Smart Pantry" Aesthetic
   ========================================= */

/* --- 1. MODERN CARDS & CONTAINERS --- */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Dashboard Stat Cards (Specific for Admin) */
.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0.5rem 0 0 0;
}

.stat-card p {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.stat-icon.orange { background: var(--primary-light); color: var(--primary-color); }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }

/* --- 2. BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-color);
    color: var(--gray-900); /* keep text dark/black on hover */
    border-color: var(--primary-color);
}

.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* --- 3. FORMS & INPUTS --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-800);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    transition: all 0.2s;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* --- 4. DATA TABLES (For Admin Lists) --- */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    text-align: left;
}

.data-table th {
    background: var(--gray-50);
    padding: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}

.data-table tr:hover {
    background: #fffcf8; /* Very subtle orange tint */
}

/* --- 5. ALERTS & BADGES --- */
.alert {
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-orange { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* --- 6. ADMIN LAYOUT HELPERS --- */
.admin-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 80px); /* Adjust based on navbar height */
}

/* Admin Sidebar */
.admin-sidebar {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.admin-content {
    padding: 2rem;
    background: var(--gray-50);
}

/* Responsive Fix for Admin */
@media (max-width: 768px) {
    .admin-grid { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; } /* Or move to a drawer */
}