/* ============================================================
   Destinito Reviews PWA — Mobile-first consumer styles
   Used by: Pages/Review/*
   ============================================================ */

:root {
    --rv-primary: #0066CC;
    --rv-primary-dark: #004fa3;
    --rv-navy: #1B3264;
    --rv-gold: #F5A623;
    --rv-accent: #f59e0b;
    --rv-success: #10b981;
    --rv-danger: #ef4444;
    --rv-bg: #f8fafc;
    --rv-card: #ffffff;
    --rv-border: #e2e8f0;
    --rv-text: #1e293b;
    --rv-muted: #64748b;
    --rv-nav-height: 64px;
    --rv-topbar-height: 62px;
    --rv-safe-bottom: env(safe-area-inset-bottom, 0px);
    --rv-safe-top: env(safe-area-inset-top, 0px);
    --rv-star-color: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body.review-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--rv-bg);
    color: var(--rv-text);
    min-height: 100dvh;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

/* ─── Top Bar ─── */
.rv-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--rv-topbar-height);
    background: var(--rv-navy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: var(--rv-safe-top);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

/* Brand mark (logo icon + wordmark) */
.rv-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.rv-topbar-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: contain;
}

.rv-topbar-brand-name {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.rv-topbar-brand-tag {
    font-weight: 600;
    color: var(--rv-gold);
}

/* Legacy selector kept for compat */
.rv-topbar-logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.rv-topbar-logo span { color: var(--rv-gold); }

.rv-topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.4);
    text-decoration: none;
    color: white;
    font-size: 15px;
}

.rv-topbar-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* ─── Main scrollable area ─── */
.rv-main {
    position: fixed;
    top: var(--rv-topbar-height);
    bottom: calc(var(--rv-nav-height) + var(--rv-safe-bottom));
    left: 0; right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.rv-main.rv-no-nav {
    bottom: 0;
}

/* ─── Bottom Navigation ─── */
.rv-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--rv-nav-height) + var(--rv-safe-bottom));
    padding-bottom: var(--rv-safe-bottom);
    background: var(--rv-card);
    border-top: 1px solid var(--rv-border);
    display: flex;
    z-index: 100;
}

.rv-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--rv-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
}

.rv-nav-item i { font-size: 20px; }

.rv-nav-item.active {
    color: var(--rv-navy);
}

/* ─── Cards ─── */
.rv-card {
    background: var(--rv-card);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border: 1px solid var(--rv-border);
}

.rv-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rv-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Buttons ─── */
.rv-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s, transform 0.1s;
    margin-bottom: 10px;
}

.rv-btn:active { transform: scale(0.97); }
.rv-btn:disabled { opacity: 0.5; pointer-events: none; }

.rv-btn.primary { background: var(--rv-primary); color: white; }
.rv-btn.success { background: var(--rv-success); color: white; }
.rv-btn.secondary { background: #f1f5f9; color: var(--rv-text); }
.rv-btn.danger { background: var(--rv-danger); color: white; }
.rv-btn.outline {
    background: transparent;
    color: var(--rv-primary);
    border: 1.5px solid var(--rv-primary);
}

/* ─── Form Elements ─── */
.rv-field {
    margin-bottom: 16px;
}

.rv-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rv-muted);
    margin-bottom: 6px;
}

.rv-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--rv-border);
    font-size: 15px;
    background: var(--rv-card);
    color: var(--rv-text);
    -webkit-appearance: none;
    transition: border-color 0.15s;
}

.rv-input:focus {
    outline: none;
    border-color: var(--rv-primary);
}

.rv-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.rv-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 36px;
}

/* ─── Stars ─── */
.rv-stars {
    display: flex;
    gap: 6px;
}

.rv-star {
    font-size: 32px;
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

.rv-star.active { color: var(--rv-star-color); }
.rv-star:active { transform: scale(1.2); }

.rv-stars-sm .rv-star { font-size: 16px; gap: 2px; }

/* ─── Category ratings ─── */
.rv-cat-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rv-cat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--rv-muted);
    width: 90px;
    flex-shrink: 0;
    text-transform: capitalize;
}

.rv-cat-stars {
    display: flex;
    gap: 4px;
}

.rv-cat-star {
    font-size: 20px;
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.rv-cat-star.active { color: var(--rv-star-color); }

/* ─── Status pills ─── */
.rv-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rv-pill.draft { background: #f1f5f9; color: var(--rv-muted); }
.rv-pill.submitted { background: #dbeafe; color: #1d4ed8; }
.rv-pill.published { background: #d1fae5; color: #065f46; }
.rv-pill.hidden { background: #fee2e2; color: #991b1b; }
.rv-pill.rejected { background: #fee2e2; color: #991b1b; }

/* ─── Review card ─── */
.rv-review-card {
    background: var(--rv-card);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--rv-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rv-review-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}

.rv-review-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rv-text);
    margin-bottom: 2px;
}

.rv-review-card-company {
    font-size: 12px;
    color: var(--rv-muted);
}

.rv-review-card-body {
    font-size: 14px;
    color: var(--rv-text);
    line-height: 1.5;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Company search result ─── */
.rv-company-item {
    background: var(--rv-card);
    border: 1px solid var(--rv-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    color: var(--rv-text);
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rv-company-item:active {
    border-color: var(--rv-primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.rv-company-logo {
    width: 48px; height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rv-muted);
    font-size: 18px;
    overflow: hidden;
}

.rv-company-logo img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.rv-company-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--rv-text);
}

.rv-company-meta {
    font-size: 12px;
    color: var(--rv-muted);
    margin-top: 2px;
}

/* ─── Photo grid ─── */
.rv-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.rv-photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

.rv-photo-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.rv-photo-remove {
    position: absolute;
    top: 4px; right: 4px;
    width: 24px; height: 24px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ─── Tags ─── */
.rv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rv-tag {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--rv-border);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--rv-muted);
    background: var(--rv-card);
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
}

.rv-tag.selected {
    border-color: var(--rv-primary);
    color: var(--rv-primary);
    background: rgba(0,102,204,0.06);
}

/* ─── Profile avatar (large) ─── */
.rv-profile-avatar {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--rv-muted);
    overflow: hidden;
    border: 3px solid var(--rv-primary);
    flex-shrink: 0;
}

.rv-profile-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* ─── Spinner ─── */
.rv-spinner {
    width: 24px; height: 24px;
    border: 3px solid rgba(0,102,204,0.2);
    border-top-color: var(--rv-primary);
    border-radius: 50%;
    animation: rv-spin 0.75s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes rv-spin {
    to { transform: rotate(360deg); }
}

/* ─── Status/alert bar ─── */
.rv-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 14px;
}

.rv-alert.info { background: #dbeafe; color: #1d4ed8; }
.rv-alert.success { background: #d1fae5; color: #065f46; }
.rv-alert.warning { background: #fef3c7; color: #92400e; }
.rv-alert.error { background: #fee2e2; color: #991b1b; }

/* ─── Section heading ─── */
.rv-section-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rv-muted);
    padding: 0 4px;
    margin-bottom: 10px;
    margin-top: 4px;
}

/* ─── Divider ─── */
.rv-divider {
    height: 1px;
    background: var(--rv-border);
    margin: 16px 0;
}

/* ─── Text helpers ─── */
.rv-text-muted { color: var(--rv-muted); font-size: 13px; }
.rv-text-center { text-align: center; }

/* ─── Empty state ─── */
.rv-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--rv-muted);
}

.rv-empty i {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    color: #cbd5e1;
}

.rv-empty p {
    font-size: 14px;
    line-height: 1.5;
}

/* ─── Auth pages (login/accept — no nav) ─── */
.rv-auth-page {
    min-height: 100dvh;
    background: var(--rv-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: calc(24px + var(--rv-safe-top));
    padding-bottom: calc(24px + var(--rv-safe-bottom));
}

.rv-auth-logo {
    font-size: 28px;
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    margin-bottom: 6px;
}

.rv-auth-logo span { color: var(--rv-accent); }

.rv-auth-tagline {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 32px;
}

.rv-auth-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.rv-auth-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--rv-text);
    margin-bottom: 4px;
}

.rv-auth-card p {
    font-size: 13px;
    color: var(--rv-muted);
    margin-bottom: 20px;
}

/* ─── Inline star display ─── */
.rv-stars-display {
    display: inline-flex;
    gap: 2px;
    color: var(--rv-star-color);
    font-size: 14px;
}

.rv-stars-display.grey { color: #cbd5e1; }

/* ── Toggle switch ─────────────────────────────────────── */
.rv-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}
.rv-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.rv-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.rv-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.rv-toggle input:checked + .rv-toggle-slider {
    background: #0066CC;
}
.rv-toggle input:checked + .rv-toggle-slider::before {
    transform: translateX(18px);
}

/* ─── Tab bar (Write page) ─── */
.rv-tab-bar {
    display: flex;
    background: var(--rv-card);
    border-bottom: 1px solid var(--rv-border);
    margin: -16px -16px 16px;     /* bleed to edge of rv-main padding */
    position: sticky;
    top: 0;
    z-index: 10;
}

.rv-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    border: none;
    background: transparent;
    color: var(--rv-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s, border-color 0.15s;
}

.rv-tab i {
    font-size: 18px;
}

.rv-tab.active {
    color: var(--rv-primary);
    border-bottom-color: var(--rv-primary);
}
