/* ============================================================
   GBP Manager — Custom Styles
   Bootstrap 5.3 base + custom component overrides
   ============================================================ */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
    --sidebar-bg:       #1e293b;
    --sidebar-width:    260px;
    --sidebar-text:     #cbd5e1;
    --sidebar-text-dim: #64748b;
    --sidebar-active:   #3b82f6;
    --sidebar-hover:    rgba(255,255,255,0.06);
    --content-bg:       #f1f5f9;
    --card-shadow:      0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
    --card-radius:      0.75rem;
    --primary:          #3b82f6;
    --success:          #22c55e;
    --warning:          #f59e0b;
    --danger:           #ef4444;
    --star-filled:      #f59e0b;
    --star-empty:       #d1d5db;
}

/* ─── Layout ─────────────────────────────────────────────────── */
html, body {
    height: 100%;
}

body {
    background: var(--content-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9375rem;
    color: #1e293b;
}

#wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.25s ease, min-width 0.25s ease;
    scrollbar-width: none;
    z-index: 100;
}

#sidebar::-webkit-scrollbar {
    display: none;
}

/* Sidebar brand */
.sidebar-brand {
    color: #fff !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background 0.15s;
}

.sidebar-brand:hover {
    background: rgba(255,255,255,0.04);
}

/* Sidebar business widget */
.sidebar-business {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
    background: rgba(59,130,246,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-active);
    font-size: 0.85rem;
}

.sidebar-sync-label {
    font-size: 0.7rem;
    color: var(--sidebar-text-dim);
    margin-top: 1px;
}

/* Sidebar nav items */
.sidebar-nav-link {
    color: var(--sidebar-text) !important;
    border-radius: 8px;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.sidebar-nav-link:hover {
    background: var(--sidebar-hover) !important;
    color: #fff !important;
}

.sidebar-nav-link.active {
    background: var(--sidebar-active) !important;
    color: #fff !important;
    font-weight: 600;
}

.sidebar-icon {
    width: 18px;
    text-align: center;
    opacity: 0.85;
}

.sidebar-nav-link.active .sidebar-icon {
    opacity: 1;
}

.sidebar-divider {
    border-color: rgba(255,255,255,0.08);
    margin: 0.5rem 0;
}

/* Sidebar user widget */
.sidebar-user {
    margin-top: auto;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: rgba(59,130,246,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Collapsed sidebar */
#wrapper.sidebar-collapsed #sidebar {
    width: 64px;
    min-width: 64px;
}

#wrapper.sidebar-collapsed .sidebar-brand span,
#wrapper.sidebar-collapsed .sidebar-nav-link span,
#wrapper.sidebar-collapsed .sidebar-business,
#wrapper.sidebar-collapsed .sidebar-user > .dropdown > a > div,
#wrapper.sidebar-collapsed .sidebar-sync-label {
    display: none !important;
}

#wrapper.sidebar-collapsed .sidebar-nav-link {
    justify-content: center !important;
    padding: 0.6rem !important;
}

/* ─── Main content ───────────────────────────────────────────── */
#page-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* ─── Navbar ──────────────────────────────────────────────────── */
.navbar {
    box-shadow: 0 1px 0 0 rgba(0,0,0,0.06);
}

/* ─── Dashboard Cards ────────────────────────────────────────── */
.dashboard-card {
    border-radius: var(--card-radius) !important;
    box-shadow: var(--card-shadow) !important;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.08) !important;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Bootstrap shadow override */
.shadow-sm {
    box-shadow: var(--card-shadow) !important;
}

/* ─── Cards (general) ────────────────────────────────────────── */
.card {
    border-radius: var(--card-radius) !important;
}

.card-header {
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}

/* ─── Star Rating ─────────────────────────────────────────────── */
.star-rating .fa-star,
.star-rating .fa-star-half-stroke {
    color: var(--star-filled);
    font-size: 0.875rem;
}

.star-rating .fa-regular.fa-star {
    color: var(--star-empty);
}

/* Large star display (reviews page) */
.review-card .star-rating .fa-star {
    font-size: 1rem;
}

/* ─── Review Cards ────────────────────────────────────────────── */
.review-card {
    border-radius: var(--card-radius) !important;
    box-shadow: var(--card-shadow) !important;
    transition: box-shadow 0.15s;
}

.review-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.08) !important;
}

.review-card .border-start.border-danger.border-3 {
    border-left-width: 4px !important;
}

.reviewer-avatar {
    flex-shrink: 0;
}

.review-text {
    border-left: 3px solid #e2e8f0;
}

.response-block {
    font-size: 0.9rem;
}

/* ─── Audit Result Rows ───────────────────────────────────────── */
.audit-row-pass td { background: rgba(34,197,94,0.04); }
.audit-row-warn td { background: rgba(245,158,11,0.08); }
.audit-row-fail td { background: rgba(239,68,68,0.06); }

/* Row hover overrides */
.table-hover .audit-row-pass:hover td { background: rgba(34,197,94,0.10); }
.table-hover .audit-row-warn:hover td { background: rgba(245,158,11,0.15); }
.table-hover .audit-row-fail:hover td { background: rgba(239,68,68,0.12); }

/* ─── Score gauge SVG ─────────────────────────────────────────── */
.score-gauge {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

/* ─── Forms ───────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.input-group-text {
    border-color: #dee2e6;
}

.form-control.border-start-0 {
    border-left: none !important;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    font-weight: 500;
    border-radius: 6px;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-success {
    background-color: #16a34a;
    border-color: #16a34a;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    font-size: 0.72em;
}

/* ─── Tables ──────────────────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* ─── Onboarding wizard ───────────────────────────────────────── */
.list-group-item-action.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ─── Business hours row ──────────────────────────────────────── */
.day-hours-row {
    transition: background 0.1s;
}

.day-hours-row:hover {
    background: #f8fafc;
}

.day-time-inputs {
    transition: opacity 0.2s;
}

/* ─── Auth pages ──────────────────────────────────────────────── */
.auth-logo {
    margin: 0 auto;
}

/* ─── Flash messages ──────────────────────────────────────────── */
#flash-messages .alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ─── Navigation tabs ─────────────────────────────────────────── */
.nav-tabs .nav-link {
    color: #64748b;
    border-color: transparent;
    border-bottom: 2px solid transparent;
    padding-bottom: 0.625rem;
    transition: color 0.15s, border-color 0.15s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border-color: transparent transparent var(--primary);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-color: transparent transparent var(--primary);
    font-weight: 600;
}

/* ─── Tone selector buttons ───────────────────────────────────── */
.tone-btn {
    border-radius: 20px !important;
    font-size: 0.8rem;
    padding: 0.3rem 1rem !important;
    transition: all 0.15s;
}

/* ─── Pagination ──────────────────────────────────────────────── */
.pagination .page-link {
    color: var(--primary);
    border-radius: 6px !important;
    margin: 0 2px;
    border: 1px solid #e2e8f0;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ─── Progress bars ───────────────────────────────────────────── */
.progress {
    border-radius: 100px;
    background: #e2e8f0;
}

.progress-bar {
    border-radius: 100px;
    transition: width 0.6s ease;
}

/* ─── AI suggestions ──────────────────────────────────────────── */
.ai-suggestion-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}

.ai-suggestion-card:hover {
    border-color: var(--primary);
    background: rgba(59,130,246,0.03);
}

.ai-suggestion-card.selected {
    border-color: var(--primary);
    background: rgba(59,130,246,0.06);
}

.ai-suggestion-card .suggestion-num {
    position: absolute;
    top: -10px;
    left: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
}

/* ─── Spinner overlay ─────────────────────────────────────────── */
.audit-spinner {
    position: relative;
}

/* ─── Responsive adjustments ──────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: calc(var(--sidebar-width) * -1);
        z-index: 1050;
        transition: left 0.25s ease;
    }

    #wrapper.sidebar-open #sidebar {
        left: 0;
    }

    #sidebar + #page-content-wrapper {
        width: 100%;
    }

    .dashboard-card .card-icon {
        width: 38px;
        height: 38px;
    }

    .review-card .d-flex.gap-2.flex-wrap {
        flex-wrap: wrap;
    }

    .table-responsive {
        font-size: 0.8rem;
    }

    .main-content {
        padding: 1rem !important;
    }
}

@media (max-width: 576px) {
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
}

/* ─── Utility ─────────────────────────────────────────────────── */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-success-subtle  { background-color: rgba(34,197,94,0.12)  !important; }
.bg-warning-subtle  { background-color: rgba(245,158,11,0.12) !important; }
.bg-danger-subtle   { background-color: rgba(239,68,68,0.12)  !important; }
.bg-info-subtle     { background-color: rgba(14,165,233,0.12) !important; }
.bg-primary-subtle  { background-color: rgba(59,130,246,0.1)  !important; }
.bg-secondary-subtle { background-color: rgba(100,116,139,0.1) !important; }

.text-success-emphasis { color: #15803d !important; }
.text-warning-emphasis { color: #b45309 !important; }
.text-danger-emphasis  { color: #b91c1c !important; }
.text-info-emphasis    { color: #0369a1 !important; }
