/* =====================================================
   Reviews Dashboard — Custom Styles
   ===================================================== */

/* Layout */
body {
    background-color: #f5f6fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.main-content {
    padding-top: 76px; /* offset fixed navbar */
    min-height: 100vh;
}

/* =====================================================
   Login page
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    padding-top: 0 !important;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* =====================================================
   KPI Cards
   ===================================================== */
.kpi-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* =====================================================
   Review cards / table
   ===================================================== */
.review-row {
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.review-row:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

.stars {
    color: #ffc107;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.stars .empty {
    color: #dee2e6;
}

.review-body-truncate {
    color: #555;
    font-size: 0.9rem;
    white-space: pre-line;
    word-break: break-word;
}

/* =====================================================
   Platform badges
   ===================================================== */
.badge-ios {
    background-color: #000;
    color: #fff;
}

.badge-android {
    background-color: #3ddc84;
    color: #000;
}

/* =====================================================
   Sentiment badges
   ===================================================== */
.badge-positive { background-color: #198754; color: #fff; }
.badge-neutral  { background-color: #6c757d; color: #fff; }
.badge-negative { background-color: #dc3545; color: #fff; }
.badge-bug      { background-color: #fd7e14; color: #fff; }
.badge-feature  { background-color: #6610f2; color: #fff; }

/* =====================================================
   Filter sidebar
   ===================================================== */
.filter-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 1.25rem;
    position: sticky;
    top: 84px;
}

.filter-sidebar .filter-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-sidebar .filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-sidebar label.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.5rem;
    display: block;
}

/* =====================================================
   Facet filter items (Version / Language lists)
   ===================================================== */
.facet-item {
    cursor: pointer;
    font-size: .82rem;
    color: #495057;
    border-radius: 6px;
    padding: 3px 4px;
    transition: background .12s;
    user-select: none;
}

.facet-item:hover {
    background: #f8f9fa;
}

.facet-item.active-facet {
    background: #eff4ff;
    color: #2563eb;
    font-weight: 600;
}

.facet-item.active-facet span:last-child {
    color: #2563eb !important;
}

/* =====================================================
   Reply modal
   ===================================================== */
#replyBody {
    font-size: 0.9rem;
    min-height: 120px;
    resize: vertical;
}

.char-counter {
    font-size: 0.78rem;
    color: #6c757d;
}

.char-counter.near-limit {
    color: #fd7e14;
}

.char-counter.at-limit {
    color: #dc3545;
}

/* =====================================================
   Charts
   ===================================================== */
.chart-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* =====================================================
   Settings page
   ===================================================== */
.settings-nav .nav-link {
    color: #495057;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 2px;
}

.settings-nav .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

.settings-nav .nav-link i {
    width: 20px;
}

.api-key-field {
    font-family: monospace;
    font-size: 0.85rem;
}

/* =====================================================
   Apps page
   ===================================================== */
.app-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.15s ease;
}

.app-card:hover {
    transform: translateY(-2px);
}

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.app-icon-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
}

/* =====================================================
   Sortable table headers
   ===================================================== */
th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th[data-sort]:hover {
    background-color: rgba(0,0,0,0.04);
}

th[data-sort] .sort-icon {
    font-size: 0.75rem;
    opacity: 0.4;
    margin-left: 4px;
}

th[data-sort].sort-active .sort-icon {
    opacity: 1;
    color: #0d6efd;
}

/* =====================================================
   Skeleton loader
   ===================================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   Sync status indicator
   ===================================================== */
.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sync-dot.success { background-color: #198754; }
.sync-dot.error   { background-color: #dc3545; }
.sync-dot.running { background-color: #ffc107; }

/* =====================================================
   Pagination
   ===================================================== */
.pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    border-color: #dee2e6;
}

/* =====================================================
   Responsive tweaks
   ===================================================== */
@media (max-width: 768px) {
    .filter-sidebar {
        position: static;
    }

    .kpi-card .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}
