/* dashboard-reports.css - private analytics on the business owner dashboard */

/* section: dashboard tabs - switch between report views */
.dashboard-tabs {
    display: flex;
    gap: 8px;
    margin: 24px 0 0;
    flex-wrap: wrap;
}

.dashboard-tab {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}

.dashboard-tab:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.dashboard-tab.active {
    background: #fff;
    border-color: #2563eb;
    border-bottom-color: #fff;
    color: #2563eb;
    margin-bottom: -2px;
    z-index: 1;
    position: relative;
}

.dashboard-tab-panel {
    display: none;
    animation: reportFadeIn 0.35s ease;
}

.dashboard-tab-panel.active {
    display: block;
}

/* section: owner unlock gate - password screen before private charts show */
.owner-gate {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 2px dashed #2563eb;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin: 24px 0;
}

.owner-gate h2 {
    color: #1e40af;
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.owner-gate p {
    color: #475569;
    margin: 0 0 20px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.owner-gate-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.owner-gate-form input {
    flex: 1;
    min-width: 160px;
    padding: 12px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    letter-spacing: 0.05em;
}

.owner-gate-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.owner-unlock-btn {
    padding: 12px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.owner-unlock-btn:hover {
    background: #1d4ed8;
}

.owner-gate-error {
    color: #dc2626;
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
}

/* section: analytics toolbar and charts - filters, export, and graph cards */
.analytics-unlocked-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dcfce7;
    color: #166534;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.analytics-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.analytics-toolbar .filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.date-preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.date-preset-btn {
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.date-preset-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.date-preset-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.analytics-toolbar input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

.analytics-export-btn {
    margin-left: auto;
    padding: 10px 18px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.analytics-export-btn:hover {
    background: #047857;
}

.analytics-export-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.analytics-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.analytics-card h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: #334155;
    font-weight: 600;
}

.analytics-card--wide {
    grid-column: 1 / -1;
}

.chart-wrap {
    position: relative;
    height: 260px;
    width: 100%;
}

.sentiment-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.sentiment-pill {
    flex: 1;
    text-align: center;
    padding: 14px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.5rem;
}

.sentiment-pill span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    opacity: 0.85;
}

.sentiment-positive {
    background: #dcfce7;
    color: #166534;
}

.sentiment-neutral {
    background: #fef9c3;
    color: #854d0e;
}

.sentiment-negative {
    background: #fee2e2;
    color: #991b1b;
}

.rating-dist-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rating-dist-row {
    display: grid;
    grid-template-columns: 48px 1fr 44px;
    align-items: center;
    gap: 10px;
}

.rating-dist-label {
    font-weight: 600;
    font-size: 14px;
    color: #475569;
}

.rating-dist-track {
    height: 22px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.rating-dist-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}



.rating-dist-pct {
    font-size: 13px;
    color: #64748b;
    text-align: right;
}

.cuisine-mini-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cuisine-mini-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.cuisine-mini-label {
    width: 90px;
    flex-shrink: 0;
    color: #475569;
    font-weight: 500;
}


.analytics-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.analytics-period-label {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
}

@keyframes reportFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* section: dark mode - night colors for dashboard analytics */
body.dark-mode .owner-gate {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #3b82f6;
}

body.dark-mode .owner-gate h2 { color: #93c5fd; }
body.dark-mode .owner-gate p { color: #94a3b8; }
body.dark-mode .analytics-card,
body.dark-mode .analytics-toolbar { background: #1e293b; border-color: #334155; }
body.dark-mode .analytics-card h3 { color: #e2e8f0; }
body.dark-mode .date-preset-btn { background: #0f172a; border-color: #475569; color: #cbd5e1; }
body.dark-mode .date-preset-btn.active { background: #2563eb; }

@media (max-width: 768px) {
    .analytics-export-btn { margin-left: 0; width: 100%; justify-content: center; }
    .chart-wrap { height: 220px; }
}
