/* Dashboard & Analytics Styles */

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1;
}

.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

.stat-change.neutral {
    color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.card-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover {
    text-decoration: underline;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

.select-period {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

/* Usage Progress */
.usage-progress {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.usage-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.usage-count {
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-light));
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.activity-time {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.quick-action-btn:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Analytics Table */
.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table thead {
    background: #f9fafb;
    border-bottom: 2px solid var(--border-color);
}

.analytics-table th {
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.analytics-table tbody tr:hover {
    background: #f9fafb;
}

.question-text {
    font-weight: 500;
}

.success-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.success-badge.high {
    background: #d1fae5;
    color: #047857;
}

.success-badge.medium {
    background: #fef3c7;
    color: #b45309;
}

.success-badge.low {
    background: #fee2e2;
    color: #dc2626;
}

/* Topics List */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.topic-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.topic-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    z-index: 1;
}

.topic-count {
    font-size: 13px;
    color: var(--text-secondary);
    z-index: 1;
}

.topic-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color-light), transparent);
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* Insights */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.insight-card {
    padding: 16px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
}

.insight-card.insight-success {
    background: #d1fae5;
    border-left: 4px solid #047857;
}

.insight-card.insight-warning {
    background: #fef3c7;
    border-left: 4px solid #b45309;
}

.insight-card.insight-info {
    background: #dbeafe;
    border-left: 4px solid #1e40af;
}

.insight-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.insight-card.insight-success .insight-icon {
    color: #047857;
}

.insight-card.insight-warning .insight-icon {
    color: #b45309;
}

.insight-card.insight-info .insight-icon {
    color: #1e40af;
}

.insight-content h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
}

.insight-content p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
}

/* Feedback Analytics Styles */
.stat-mini {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-mini .stat-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-mini .stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-mini .stat-stars {
    color: #fbbf24;
    font-size: 0.875rem;
}

.stat-mini .stat-trend {
    font-size: 0.75rem;
    color: #94a3b8;
}

.feedback-preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feedback-preview-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.feedback-preview-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
}

.feedback-preview-item.rating-5 {
    border-left-color: #10b981;
}

.feedback-preview-item.rating-4 {
    border-left-color: #3b82f6;
}

.feedback-preview-item.rating-3 {
    border-left-color: #f59e0b;
}

.feedback-preview-item.rating-2 {
    border-left-color: #f97316;
}

.feedback-preview-item.rating-1 {
    border-left-color: #ef4444;
}

.feedback-rating {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}

.feedback-rating.rating-5 {
    background: linear-gradient(135deg, #10b981, #059669);
}

.feedback-rating.rating-4 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.feedback-rating.rating-3 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.feedback-rating.rating-2 {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.feedback-rating.rating-1 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.feedback-content {
    flex: 1;
    min-width: 0;
}

.feedback-text {
    font-size: 0.875rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feedback-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.loading-text {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}
