/* HelpScout Dashboard Frontend Styles */

.helpscout-frontend-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0 20px;
}

/* Header */
.helpscout-frontend-header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.helpscout-title {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.helpscout-subtitle {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Grid Layout - 5 panels: 2 panels per row, 3 rows */
.helpscout-frontend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Center the last panel (5th panel) on its own row */
.helpscout-panel:nth-child(5) {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
}

/* Panel Base Styles */
.helpscout-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid #e5e5e5;
}

.helpscout-panel-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* Happiness Score Panel */
.helpscout-happiness-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.helpscout-circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#22c55e 0deg, #22c55e 342deg, #e5e5e5 342deg, #e5e5e5 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.helpscout-circular-inner {
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.helpscout-percentage {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

/* Chart Panel */
.helpscout-chart-container {
    height: 200px;
    position: relative;
    width: 100%;
}

.helpscout-chart-container canvas {
    width: 100% !important;
    height: 200px !important;
    display: block;
}

/* Metric Panels */
.helpscout-metric-container {
    text-align: center;
    padding: 20px 0;
}

.helpscout-metric-icon {
    margin-bottom: 15px;
}

.helpscout-metric-icon .fa {
    font-size: 40px;
    color: #3b82f6;
    width: 40px;
    height: 40px;
    display: inline-block;
    text-align: center;
    line-height: 40px;
}

.helpscout-metric-value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.helpscout-metric-label {
    color: #666;
    font-size: 14px;
    text-transform: capitalize;
}

/* Emergency Response Panel Styling */
.helpscout-emergency-panel {
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    border-left: 4px solid #ef4444;
}

.helpscout-emergency-icon {
    color: #ef4444 !important;
}

.helpscout-emergency-panel .helpscout-metric-value {
    color: #dc2626;
}

.helpscout-panel-period {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* Footer */
.helpscout-frontend-footer {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.helpscout-last-updated {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Notice/Error Styles */
.helpscout-notice {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.helpscout-notice-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-left: 4px solid #3b82f6;
}

.helpscout-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
    font-weight: 500;
}

/* Dark Theme */
.helpscout-theme-dark {
    background: #1a202c;
    color: #e2e8f0;
}

.helpscout-theme-dark .helpscout-panel {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.helpscout-theme-dark .helpscout-title {
    color: #f7fafc;
}

.helpscout-theme-dark .helpscout-panel-title {
    color: #f7fafc;
}

.helpscout-theme-dark .helpscout-metric-value {
    color: #f7fafc;
}

.helpscout-theme-dark .helpscout-circular-inner {
    background: #2d3748;
}

.helpscout-theme-dark .helpscout-percentage {
    color: #f7fafc;
}

.helpscout-theme-dark .helpscout-frontend-footer {
    background: #2d3748;
}

/* Light Theme */
.helpscout-theme-light .helpscout-panel {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .helpscout-frontend-dashboard {
        padding: 0 16px;
    }
    
    .helpscout-frontend-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Reset grid positioning for mobile */
    .helpscout-panel:nth-child(5) {
        grid-column: auto;
        max-width: 100%;
        margin: 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .helpscout-frontend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    /* Reset grid positioning for tablet */
    .helpscout-panel:nth-child(5) {
        grid-column: auto;
        max-width: 100%;
        margin: 0;
    }
}
    
    .helpscout-panel {
        padding: 20px;
    }
    
    .helpscout-title {
        font-size: 24px;
    }
    
    .helpscout-circular-progress {
        width: 120px;
        height: 120px;
    }
    
    .helpscout-circular-inner {
        width: 85px;
        height: 85px;
    }
    
    .helpscout-percentage {
        font-size: 24px;
    }
    
    .helpscout-metric-value {
        font-size: 28px;
    }
    
    .helpscout-chart-container {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .helpscout-frontend-dashboard {
        padding: 0 12px;
    }
    
    .helpscout-panel {
        padding: 16px;
    }
    
    .helpscout-title {
        font-size: 20px;
    }
    
    .helpscout-circular-progress {
        width: 100px;
        height: 100px;
    }
    
    .helpscout-circular-inner {
        width: 70px;
        height: 70px;
    }
    
    .helpscout-percentage {
        font-size: 20px;
    }
    
    .helpscout-metric-value {
        font-size: 24px;
    }
}

/* Animation for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.helpscout-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

