/* ============================================================
   Hire Me For — Global Stylesheet
   Primary colour: #2563eb (blue)
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #f3f4f6;
    color: #111827;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── Layout helpers ───────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-main {
    flex: 1;
    padding: 2rem 1rem;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: -0.5px;
    text-decoration: none;
}
.site-logo:hover { text-decoration: none; color: #1d4ed8; }

.site-nav { display: flex; gap: 1rem; align-items: center; }

.site-nav a {
    font-size: 0.9rem;
    color: #374151;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.site-nav a:hover { background: #f3f4f6; text-decoration: none; }

.site-nav .btn-nav-primary {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}
.site-nav .btn-nav-primary:hover { background: #1d4ed8; }

.site-nav .worker-greeting { font-size: 0.85rem; color: #6b7280; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    padding: 1.25rem 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 1.5rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled)   { background: #1d4ed8; text-decoration: none; }

.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover:not(:disabled) { background: #d1d5db; text-decoration: none; }

.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-whatsapp  { background: #25d366; color: #fff; }
.btn-whatsapp:hover:not(:disabled) { background: #1ebe5c; }

.btn-full { width: 100%; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-group textarea { resize: vertical; }

.char-counter {
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: right;
    margin-top: 0.2rem;
}
.char-counter.warning { color: #d97706; }
.char-counter.limit   { color: #dc2626; }

/* Grid 2 columns */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

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

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}
.spinner-dark {
    border-color: rgba(0,0,0,.15);
    border-top-color: #374151;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Stars ────────────────────────────────────────────────── */
.stars { color: #d1d5db; font-size: 1.2rem; letter-spacing: 1px; }
.stars .filled { color: #f59e0b; }
.stars.clickable span { cursor: pointer; transition: color 0.1s; }
.stars.clickable span:hover,
.stars.clickable span:hover ~ span { color: #f59e0b; }
/* reverse hover trick via flex-direction:row-reverse handled in JS */

/* ── Profile photo ────────────────────────────────────────── */
.photo-circle {
    border-radius: 50%;
    object-fit: cover;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-weight: 700;
    font-size: 1.5rem;
    overflow: hidden;
    flex-shrink: 0;
}
.photo-sm  { width: 64px;  height: 64px;  font-size: 1.2rem; }
.photo-lg  { width: 120px; height: 120px; font-size: 2rem; }
.photo-xl  { width: 160px; height: 160px; font-size: 2.5rem; }

.photo-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── Skill tag ────────────────────────────────────────────── */
.skill-tag {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 20px;
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.15rem;
}

/* ── Worker cards (search results) ───────────────────────── */
.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.worker-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
    cursor: pointer;
}
.worker-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); text-decoration: none; }

.worker-card-info h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.worker-card-area { font-size: 0.85rem; color: #6b7280; margin-bottom: 0.4rem; }
.worker-card-rating { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: #6b7280; margin-top: 0.4rem; }

/* ── Search section ───────────────────────────────────────── */
.search-section { margin-bottom: 2rem; }
.search-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }

.search-form .search-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.search-form .search-row .form-group { margin-bottom: 0; flex: 1; min-width: 180px; }

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.results-bar h3 { font-size: 1rem; color: #374151; }
.sort-controls, .per-page-controls { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.sort-controls select, .per-page-controls select {
    padding: 0.35rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
}

.empty-state, .loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #374151;
}

/* ── Autocomplete dropdown ────────────────────────────────── */
.autocomplete-wrap { position: relative; }

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}
.autocomplete-dropdown.open { display: block; }

.autocomplete-item {
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.highlighted { background: #eff6ff; color: #2563eb; }

/* ── Worker profile page ──────────────────────────────────── */
.profile-header-section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.profile-details h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.25rem; }
.profile-details .location { color: #6b7280; margin-bottom: 0.2rem; }
.profile-details .age-gender { font-size: 0.88rem; color: #9ca3af; margin-bottom: 0.75rem; }

.profile-section { margin-top: 1.75rem; }
.profile-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; border-bottom: 1px solid #f3f4f6; padding-bottom: 0.4rem; }

.skills-list { display: flex; flex-direction: column; gap: 0.5rem; }
.skill-item { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }
.skill-item .skill-years { color: #6b7280; font-size: 0.82rem; }

.reviews-list { display: flex; flex-direction: column; gap: 1rem; }
.review-item { border: 1px solid #f3f4f6; border-radius: 8px; padding: 0.75rem; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.review-date { font-size: 0.8rem; color: #9ca3af; }
.review-comment { font-size: 0.9rem; color: #374151; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}
.modal-note { font-size: 0.8rem; color: #9ca3af; margin-top: 0.75rem; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #166534;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    z-index: 2000;
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Auth pages (login, register, forgot-pin) ─────────────── */
.auth-page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
}
.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Step indicator */
.step-dots {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.step-dot {
    height: 4px;
    border-radius: 2px;
    flex: 1;
    max-width: 40px;
    background: #e5e7eb;
    transition: background 0.2s;
}
.step-dot.active { background: #2563eb; }

/* Skills multi-select in register */
.skills-rows { display: flex; flex-direction: column; gap: 0.6rem; }
.skill-row { display: flex; gap: 0.5rem; align-items: center; }
.skill-row select { flex: 1; }
.skill-row .years-input { width: 90px; }
.skill-row .remove-btn {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    line-height: 1;
}
.skill-row .remove-btn:hover { background: #fef2f2; }

/* Photo preview */
.photo-preview-wrap { margin-top: 0.5rem; }
.photo-preview-wrap img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid #d1d5db; }

/* ── WhatsApp contact button ──────────────────────────────── */
.contact-buttons { display: flex; gap: 0.75rem; margin-top: 0.75rem; flex-wrap: wrap; }

/* ── QR code section ──────────────────────────────────────── */
.qr-section { text-align: center; }
.qr-hint { font-size: 0.85rem; color: #9ca3af; margin-top: 0.5rem; }

/* ── Gallery ──────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.gallery-item { border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; }
.gallery-item img { width: 100%; height: 140px; object-fit: cover; display: block; }
.gallery-caption { font-size: 0.78rem; color: #6b7280; padding: 0.3rem 0.4rem; background: #fff; }

/* Lightbox */
.lightbox-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-inner { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox-inner img { max-width: 90vw; max-height: 85vh; border-radius: 8px; }
.lightbox-close {
    position: absolute; top: -2rem; right: 0;
    background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 2rem;
    border-radius: 50%; width: 44px; height: 44px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-nav.prev { left: -3rem; }
.lightbox-nav.next { right: -3rem; }
.lightbox-caption { color: #d1d5db; font-size: 0.85rem; text-align: center; margin-top: 0.5rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .search-form .search-row { flex-direction: column; }
    .results-bar { flex-direction: column; align-items: flex-start; }
    .profile-header-section { flex-direction: column; align-items: center; text-align: center; }
    .profile-details { text-align: center; }
    .workers-grid { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column-reverse; }
    .lightbox-nav.prev { left: -2rem; }
    .lightbox-nav.next { right: -2rem; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-buttons { flex-direction: column; }
}
