/* ========================================
   GroomingPro — Main Stylesheet
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: #1e293b; background: #f8fafc; line-height: 1.6; }
a { color: #3b82f6; text-decoration: none; }
a:hover { color: #2563eb; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: #1e293b; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
.text-muted { color: #94a3b8; }
.text-sm { font-size: 0.875rem; }

/* --- Forms --- */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="date"], input[type="file"], select, textarea {
    width: 100%; padding: 0.625rem 0.875rem; border: 1px solid #d1d5db; border-radius: 0.5rem; font-size: 1rem; transition: border-color 0.2s, box-shadow 0.2s; background: #fff; color: #1e293b;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
textarea { resize: vertical; min-height: 2.5rem; }
label { display: block; font-weight: 600; margin-bottom: 0.375rem; font-size: 0.875rem; color: #374151; }
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1.25rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.btn-primary, button.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover { background: #f3f4f6; }
.btn-cancel, a.btn-cancel { background: #f1f5f9; color: #64748b; padding: 0.625rem 1.25rem; border-radius: 0.5rem; border: 1px solid #e2e8f0; }
.btn-cancel:hover { background: #e2e8f0; }
.btn-small { display: inline-flex; align-items: center; justify-content: center; padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.75rem; border: 1px solid #e2e8f0; background: #fff; cursor: pointer; }
.btn-small:hover { background: #f8fafc; }
.btn-active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.btn-active:hover { background: #2563eb; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; }
.form-actions .btn-primary { padding: 0.75rem 2rem; }

/* --- Alerts --- */
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* --- Status Badges --- */
.status-badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* --- Tables --- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { background: #f8fafc; color: #64748b; font-weight: 600; text-align: left; padding: 0.75rem 1rem; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.admin-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions form { display: inline; }
.icon-cell { font-size: 1.25rem; text-align: center; }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 0.25rem; margin-top: 2rem; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; height: 2.5rem; border-radius: 0.375rem; border: 1px solid #e2e8f0; background: #fff; font-size: 0.875rem; transition: all 0.2s; }
.page-link:hover { background: #f8fafc; border-color: #cbd5e1; }
.page-link.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.empty-state a { color: #3b82f6; }

/* --- Layout: Admin Sidebar --- */
.admin-sidebar { position: fixed; top: 0; left: 0; width: 240px; height: 100vh; background: #1e293b; color: #fff; padding: 1rem 0; z-index: 100; overflow-y: auto; }
.sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid #334155; }
.sidebar-logo { color: #fff; font-size: 1.125rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.sidebar-nav { padding: 0.75rem 0; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1.25rem; color: #94a3b8; font-size: 0.875rem; transition: all 0.2s; }
.nav-item:hover { background: #334155; color: #fff; }
.nav-item.active { background: #334155; color: #3b82f6; font-weight: 600; }
.nav-divider { border: none; border-top: 1px solid #334155; margin: 0.75rem 1.25rem; }
.logout { color: #f87171; }
.logout:hover { background: #7f1d1d; color: #fca5a5; }
.admin-main { margin-left: 240px; min-height: 100vh; }
.admin-header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.admin-header h1 { font-size: 1.25rem; }
.admin-content { padding: 2rem; }
.section { margin-top: 2rem; }
.section h2 { font-size: 1.125rem; margin-bottom: 1rem; }
.header-actions { display: flex; gap: 0.5rem; }

/* --- Stats Grid --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: 0.75rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 1rem; }
.stat-icon { font-size: 2rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 0.8125rem; color: #94a3b8; }

/* --- View Card (admin appointment view) --- */
.view-card { background: #fff; border-radius: 0.75rem; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.view-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.view-section { margin-bottom: 1.5rem; }
.view-section h3 { font-size: 0.9375rem; color: #64748b; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #f1f5f9; }
.view-table { width: 100%; }
.view-table td { padding: 0.375rem 0; vertical-align: top; }
.view-table td:first-child { color: #94a3b8; padding-right: 1rem; white-space: nowrap; }
.view-actions { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e2e8f0; display: flex; gap: 1rem; }

/* --- Breed selector (step 2) --- */
.search-box { margin-bottom: 1rem; }
.search-box input { background: #f1f5f9; border-color: transparent; }
.search-box input:focus { background: #fff; }
.breed-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; max-height: 360px; overflow-y: auto; }
.breed-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s; }
.breed-item:hover { border-color: #3b82f6; background: #eff6ff; }
.breed-item.selected { border-color: #3b82f6; background: #dbeafe; }
.breed-icon { font-size: 1.25rem; }
.breed-name { flex: 1; font-size: 0.875rem; }
.breed-check { color: #3b82f6; font-weight: 700; }
.loading, .no-results, .time-hint { color: #94a3b8; font-size: 0.875rem; padding: 1rem; }
.no-slots { color: #ef4444; }

/* --- Pet type selector (step 1) --- */
.pet-type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.pet-type-option { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2.5rem 1rem; background: #fff; border: 2px solid #e2e8f0; border-radius: 1rem; cursor: pointer; transition: all 0.2s; }
.pet-type-option:hover { border-color: #93c5fd; }
.pet-type-option.selected { border-color: #3b82f6; background: #eff6ff; }
.pet-type-icon { font-size: 3.5rem; }
.pet-type-label { font-size: 1.25rem; font-weight: 700; }
.pet-type-check { display: none; color: #3b82f6; font-weight: 700; font-size: 1.25rem; }
.pet-type-option.selected .pet-type-check { display: block; }

/* --- Service selector (step 3) --- */
.services-selector { display: flex; flex-direction: column; gap: 0.5rem; }
.service-select-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; cursor: pointer; transition: all 0.2s; }
.service-select-item:hover { border-color: #93c5fd; background: #eff6ff; }
.service-select-item.selected { border-color: #3b82f6; background: #dbeafe; }
.service-select-icon { font-size: 1.5rem; min-width: 2rem; text-align: center; }
.service-select-info { flex: 1; }
.service-select-name { font-weight: 600; margin-bottom: 0.25rem; }
.service-select-desc { font-size: 0.8125rem; color: #64748b; }
.service-select-meta { text-align: right; flex-shrink: 0; }
.service-select-time { display: block; font-size: 0.75rem; color: #64748b; }
.service-select-price { display: block; font-weight: 700; color: #059669; font-size: 1rem; }
.service-select-check { display: none; color: #3b82f6; font-weight: 700; font-size: 1.25rem; }
.service-select-item.selected .service-select-check { display: block; }
.service-summary { background: #f1f5f9; border-radius: 0.75rem; padding: 1rem 1.25rem; margin-top: 1rem; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 0.25rem 0; }
.summary-total { border-top: 1px solid #e2e8f0; margin-top: 0.5rem; padding-top: 0.5rem; font-size: 1.125rem; }

/* --- Haircut selector (step 4) --- */
.haircut-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.haircut-option { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; cursor: pointer; transition: all 0.2s; }
.haircut-option:hover { border-color: #93c5fd; }
.haircut-option.selected { border-color: #8b5cf6; background: #f5f3ff; }
.haircut-icon { font-size: 1.5rem; }
.haircut-info { flex: 1; }
.haircut-name { font-weight: 600; font-size: 0.875rem; }
.haircut-desc { font-size: 0.75rem; color: #64748b; }
.haircut-check { display: none; color: #8b5cf6; font-weight: 700; }
.haircut-option.selected .haircut-check { display: block; }

/* --- Master selector (step 5) --- */
.masters-selector { display: flex; flex-direction: column; gap: 0.75rem; }
.master-select-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; cursor: pointer; transition: all 0.2s; }
.master-select-item:hover { border-color: #93c5fd; background: #eff6ff; }
.master-select-item.selected { border-color: #3b82f6; background: #dbeafe; }
.master-select-avatar { width: 3rem; height: 3rem; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.master-select-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { width: 100%; height: 100%; background: #3b82f6; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; }
.master-select-info { flex: 1; }
.master-select-name { font-weight: 600; }
.master-select-experience { font-size: 0.8125rem; color: #64748b; }
.master-select-bio { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }
.master-select-rating { text-align: center; flex-shrink: 0; }
.stars { font-size: 0.875rem; }
.rating-value { display: block; font-size: 0.75rem; color: #64748b; }
.master-select-check { display: none; color: #3b82f6; font-weight: 700; font-size: 1.25rem; }
.master-select-item.selected .master-select-check { display: block; }

/* --- DateTime selector (step 6) --- */
.datetime-selector { display: grid; gap: 1.5rem; }
.date-picker input[type="date"] { padding: 0.75rem; font-size: 1rem; }
.time-picker label { margin-bottom: 0.75rem; }
.time-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; }
.time-slot { padding: 0.625rem; text-align: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5rem; cursor: pointer; font-size: 0.875rem; transition: all 0.2s; }
.time-slot:hover { border-color: #3b82f6; background: #eff6ff; }
.time-slot.selected { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* --- Client form (step 7) --- */
.client-form { margin-top: 1.5rem; }
#client-lookup-result { margin-top: 0.5rem; }
.lookup-found { background: #f0fdf4; color: #166534; padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.8125rem; border: 1px solid #bbf7d0; }
.ref-image-input { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.ref-image-input input[type="text"] { flex: 1; }
.or-divider { color: #94a3b8; font-size: 0.875rem; }

/* --- Confirmation (step 8) --- */
.confirmation-card { display: flex; flex-direction: column; gap: 1rem; }
.confirmation-section { background: #f8fafc; border-radius: 0.75rem; padding: 1rem 1.25rem; }
.confirmation-section h3 { font-size: 0.9375rem; color: #64748b; margin-bottom: 0.5rem; }
.confirmation-table { width: 100%; }
.confirmation-table td { padding: 0.375rem 0; }
.confirmation-table td:first-child { color: #64748b; }
.confirmation-total td { border-top: 1px solid #e2e8f0; padding-top: 0.5rem; margin-top: 0.5rem; }

/* --- Success page --- */
.success-card .appointment-details { background: #f8fafc; border-radius: 0.75rem; padding: 1.5rem; margin: 1.5rem 0; }

/* --- Order summary (step 7) --- */
#order-summary { background: #f1f5f9; border-radius: 0.75rem; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
#order-summary h3 { font-size: 1rem; margin-bottom: 0.75rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .admin-sidebar { width: 56px; }
    .admin-sidebar .sidebar-logo span, .admin-sidebar .nav-item span { display: none; }
    .admin-main { margin-left: 56px; }
    .admin-header { padding: 0.75rem 1rem; }
    .admin-content { padding: 1rem; }
    .pet-type-selector { gap: 0.75rem; }
    .pet-type-option { padding: 1.5rem 0.75rem; }
    .haircut-selector { grid-template-columns: 1fr; }
    .view-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Frontend — Site Header / Footer / Hero
   ============================================ */

/* Site Header */
.site-header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0.75rem 0; position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.25rem; font-weight: 700; color: #1e293b; text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.logo-accent { color: #3b82f6; }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { color: #475569; font-size: 0.9375rem; font-weight: 500; transition: color 0.2s; }
.main-nav a:hover { color: #3b82f6; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #475569; }
@media (max-width: 640px) { .main-nav { display: none; } .mobile-menu-btn { display: block; } }

/* Main Content */
.main-content { min-height: calc(100vh - 60px); }

/* Hero */
.hero { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #e0e7ff 100%); padding: 4rem 0; }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-content h1 { font-size: 2.5rem; line-height: 1.15; margin-bottom: 1rem; }
.hero-content p { font-size: 1.125rem; color: #475569; margin-bottom: 2rem; max-width: 480px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-actions .btn { padding: 0.875rem 2rem; border-radius: 0.5rem; font-weight: 600; font-size: 1rem; text-decoration: none; }
.hero-actions .btn-primary { background: #3b82f6; color: #fff; }
.hero-actions .btn-outline { background: transparent; border: 2px solid #3b82f6; color: #3b82f6; }
.hero-emoji { font-size: 8rem; text-align: center; }
@media (max-width: 768px) {
    .hero { padding: 3rem 0; }
    .hero .container { grid-template-columns: 1fr; text-align: center; }
    .hero-content p { margin: 0 auto 2rem; }
    .hero-actions { justify-content: center; }
    .hero-emoji { font-size: 5rem; }
}

/* Section Padding */
.section-padding { padding: 4rem 0; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 3rem; }

/* Features */
.features { background: #fff; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.feature-card { text-align: center; padding: 2rem 1rem; border-radius: 1rem; transition: box-shadow 0.3s; }
.feature-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.feature-card p { color: #64748b; font-size: 0.9375rem; }

/* Services Grid */
.services { background: #f8fafc; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.service-card { display: flex; gap: 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 1.25rem; cursor: pointer; transition: all 0.2s; }
.service-card:hover { border-color: #3b82f6; box-shadow: 0 2px 12px rgba(59,130,246,0.1); }
.service-icon { font-size: 2rem; min-width: 2.5rem; text-align: center; }
.service-info { flex: 1; }
.service-info h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.service-desc { color: #64748b; font-size: 0.8125rem; margin-bottom: 0.5rem; }
.service-meta { display: flex; justify-content: space-between; font-size: 0.8125rem; }
.service-time { color: #64748b; }
.service-price { font-weight: 700; color: #059669; }

/* Masters Grid */
.masters { background: #fff; }
.masters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2rem; }
.master-card { text-align: center; padding: 2rem 1rem; border-radius: 1rem; border: 1px solid #e2e8f0; transition: all 0.2s; }
.master-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.master-avatar { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; margin: 0 auto 1rem; }
.master-avatar img, .master-avatar .avatar-placeholder { width: 100%; height: 100%; }
.master-card h3 { font-size: 1.125rem; }
.master-experience { color: #64748b; font-size: 0.875rem; margin: 0.25rem 0 0.5rem; }
.master-rating { margin-bottom: 0.5rem; }
.master-bio { color: #94a3b8; font-size: 0.8125rem; }

/* CTA */
.cta { background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%); color: #fff; }
.cta-content { text-align: center; }
.cta-content h2 { font-size: 2rem; color: #fff; margin-bottom: 0.5rem; }
.cta-content p { color: #94a3b8; margin-bottom: 2rem; font-size: 1.125rem; }
.cta-content .btn-primary { background: #3b82f6; color: #fff; padding: 0.875rem 2.5rem; border-radius: 0.5rem; font-weight: 600; text-decoration: none; display: inline-block; }

/* Site Footer */
.site-footer { background: #1e293b; color: #94a3b8; padding: 2rem 0; text-align: center; font-size: 0.875rem; border-top: 1px solid #334155; }
