/* ============================================================
   assets/css/style.css
   PetRaters base design system
   - Background: White | Accent: Green (#1D9E75) | Text: Dark
   - Font: Inter
   - Dark mode: prefers-color-scheme OR manual .dark-mode class on <body>
   ============================================================ */

:root {
    --color-bg: #ffffff;
    --color-surface: #f7f9f8;
    --color-text: #1a1f1d;
    --color-text-muted: #6b7280;
    --color-accent: #1D9E75;
    --color-accent-dark: #167a5c;
    --color-border: #e5e7eb;
    --color-danger: #dc2626;
    --color-success: #16a34a;
    --color-star: #f5a623;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

body.dark-mode {
    --color-bg: #0f1412;
    --color-surface: #161c1a;
    --color-text: #f0f2f1;
    --color-text-muted: #9ca3af;
    --color-border: #2a3330;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Navbar ---------- */
.navbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 0;
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar .logo {
    font-weight: 800;
    font-size: 20px;
    color: var(--color-accent);
}
.navbar .nav-links { display: flex; gap: 18px; align-items: center; }
.navbar .nav-links a { color: var(--color-text); font-weight: 500; }
.navbar .btn-primary { padding: 8px 16px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 11px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); text-decoration: none; }
.btn-block { display: block; width: 100%; }

/* ---------- Forms / Auth pages ---------- */
.auth-wrapper {
    max-width: 460px;
    margin: 48px auto;
    padding: 32px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.auth-wrapper.wide { max-width: 640px; }
.auth-wrapper h1 { font-size: 22px; margin-top: 0; }
.auth-wrapper .subtitle { color: var(--color-text-muted); margin-top: -8px; margin-bottom: 24px; font-size: 14px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--color-bg);
    color: var(--color-text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(29,158,117,0.15);
}

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ---------- Pet rows (dynamic add) ---------- */
.pet-row {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    position: relative;
    background: var(--color-bg);
}
.pet-row .remove-pet {
    position: absolute;
    top: 8px; right: 10px;
    color: var(--color-danger);
    cursor: pointer;
    font-size: 13px;
    background: none; border: none;
}
#add-pet-btn { margin-bottom: 18px; }

/* ---------- Alerts / Flash ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-success { background: #e8f8f1; color: #0f6b4c; border: 1px solid #b8e6cf; }
.alert-error { background: #fdecec; color: #a31a1a; border: 1px solid #f6c6c6; }
body.dark-mode .alert-success { background: #0e2a20; color: #6fe0ab; border-color: #1c4a37; }
body.dark-mode .alert-error { background: #2a1414; color: #f29a9a; border-color: #4a1c1c; }

/* ---------- Verification code input ---------- */
.code-input {
    text-align: center;
    font-size: 28px;
    letter-spacing: 12px;
    font-weight: 700;
}

/* ---------- Footer (placeholder — full footer in later step) ---------- */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 28px 0;
    margin-top: 48px;
    color: var(--color-text-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 600px) {
    .form-row { flex-direction: column; }
    .auth-wrapper { margin: 20px 16px; padding: 22px; }
}

/* ============================================================
   HOMEPAGE
   ============================================================ */

.hero {
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
    padding: 56px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}
.hero h1 { font-size: 34px; margin: 0 0 10px; }
.hero p.subtitle { color: var(--color-text-muted); font-size: 16px; margin-bottom: 28px; }

.search-bar {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--shadow);
}
.search-bar input {
    border: none;
    flex: 1;
    padding: 12px 14px;
    font-size: 15px;
    background: transparent;
}
.search-bar input:focus { outline: none; box-shadow: none; }
.search-bar button {
    border: none;
}

/* ---------- Category pills ---------- */
.category-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 22px 0 4px;
    scrollbar-width: thin;
}
.category-pill {
    flex-shrink: 0;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.category-pill:hover, .category-pill.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    text-decoration: none;
}

/* ---------- Section headers ---------- */
.section { padding: 36px 0; }
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-header h2 { font-size: 21px; margin: 0; }
.section-header a { font-size: 13px; font-weight: 600; }

/* ---------- Product grid / card ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

.product-card {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
    color: var(--color-text);
    transition: box-shadow 0.15s, transform 0.15s;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.product-card-img { aspect-ratio: 1; background: var(--color-surface); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { padding: 12px; }
.product-card-category { font-size: 11px; color: var(--color-accent); font-weight: 700; text-transform: uppercase; }
.product-card-brand { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.product-card-name { font-size: 14px; font-weight: 600; margin: 2px 0 8px; line-height: 1.3; }
.product-card-rating { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.product-card-rating .rating-number { font-weight: 700; }
.product-card-rating .review-count { color: var(--color-text-muted); }

/* ---------- Review feed (homepage + listing pages) ---------- */
.review-feed-item {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--color-border);
}
.review-feed-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.review-feed-content { flex: 1; }
.review-feed-meta { font-size: 13px; color: var(--color-text-muted); margin-bottom: 4px; }
.review-feed-meta strong { color: var(--color-text); }
.review-feed-title { font-weight: 700; margin: 2px 0 4px; }
.review-feed-body { font-size: 14px; color: var(--color-text-muted); }
.empty-state { text-align: center; padding: 40px 0; color: var(--color-text-muted); }

/* ---------- Listing page (filters + sort) ---------- */
.listing-layout { display: flex; gap: 28px; align-items: flex-start; }
.filters-sidebar {
    width: 230px;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--color-surface);
}
.filters-sidebar h3 { font-size: 14px; margin: 0 0 10px; }
.filter-group { margin-bottom: 20px; }
.filter-group label.option {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; margin-bottom: 8px; cursor: pointer; font-weight: 400;
}
.listing-main { flex: 1; min-width: 0; }
.listing-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.listing-toolbar .result-count { font-size: 13px; color: var(--color-text-muted); }
.listing-toolbar select { width: auto; padding: 8px 10px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
    padding: 8px 13px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 13px;
}
.pagination a:hover { border-color: var(--color-accent); text-decoration: none; }
.pagination .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

@media (max-width: 768px) {
    .listing-layout { flex-direction: column; }
    .filters-sidebar { width: 100%; }
}


/* ============================================================
   USER PROFILE PAGE
   ============================================================ */

.profile-header {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 30px 0;
    border-bottom: 1px solid var(--color-border);
}
.profile-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; min-width: 220px; }
.profile-info h1 { font-size: 22px; margin: 0 0 2px; }
.profile-meta { color: var(--color-text-muted); font-size: 13px; margin-bottom: 8px; }
.profile-bio { font-size: 14px; margin-bottom: 10px; max-width: 560px; }

.profile-stats { display: flex; gap: 26px; margin-top: 12px; flex-wrap: wrap; }
.profile-stat { text-align: left; }
.profile-stat .num { font-size: 19px; font-weight: 800; display: block; }
.profile-stat .label { font-size: 12px; color: var(--color-text-muted); }

.badge-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.badge-chip.verified { color: #1D9E75; border-color: #1D9E75; background: rgba(29,158,117,0.08); }
.badge-chip.top-reviewer { color: #b8860b; border-color: #b8860b; background: rgba(184,134,11,0.08); }
.badge-chip.streak { color: #d35400; border-color: #d35400; background: rgba(211,84,0,0.08); }
.badge-chip.premium { color: #6c2bd9; border-color: #6c2bd9; background: rgba(108,43,217,0.08); }

.pet-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .pet-card-grid { grid-template-columns: repeat(2, 1fr); } }
.pet-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    background: var(--color-bg);
    position: relative;
}
.pet-card .pet-emoji { font-size: 30px; }
.pet-card .pet-name { font-weight: 700; margin-top: 6px; }
.pet-card .pet-meta { font-size: 12px; color: var(--color-text-muted); }
.pet-card .pet-actions { margin-top: 8px; display: flex; gap: 8px; justify-content: center; font-size: 12px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin: 28px 0 20px; }
.tab-link {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
}
.tab-link.active { color: var(--color-accent); border-color: var(--color-accent); }
.tab-link:hover { text-decoration: none; color: var(--color-accent); }


/* ============================================================
   ADMIN PANEL
   ============================================================ */

.admin-layout { display: flex; min-height: calc(100vh - 65px); }
.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 22px 0;
}
.admin-sidebar a {
    display: block;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}
.admin-sidebar a:hover { background: var(--color-border); text-decoration: none; }
.admin-sidebar a.active { background: var(--color-accent); color: #fff; }
.admin-sidebar .badge-count {
    background: var(--color-danger); color: #fff; border-radius: 999px;
    font-size: 11px; padding: 1px 7px; margin-left: 6px;
}
.admin-main { flex: 1; padding: 28px 32px; min-width: 0; }
.admin-main h1 { font-size: 22px; margin: 0 0 18px; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--color-bg);
}
.stat-card .num { font-size: 26px; font-weight: 800; }
.stat-card .label { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--color-bg); }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.admin-table th { color: var(--color-text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.admin-table tr:hover { background: var(--color-surface); }

.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-block; }
.status-pill.active, .status-pill.approved, .status-pill.resolved { background: rgba(29,158,117,0.12); color: #1D9E75; }
.status-pill.pending { background: rgba(245,166,35,0.15); color: #b8860b; }
.status-pill.banned, .status-pill.rejected, .status-pill.removed { background: rgba(220,38,38,0.12); color: #dc2626; }
.status-pill.suspended, .status-pill.hidden, .status-pill.dismissed { background: rgba(107,114,128,0.15); color: #6b7280; }

.admin-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; background: var(--color-bg); margin-bottom: 16px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.admin-filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.admin-filters select, .admin-filters input { width: auto; padding: 8px 10px; font-size: 13px; }

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; }
    .admin-sidebar a { white-space: nowrap; }
    .admin-main { padding: 20px 16px; }
}
