/* PERK Reports App - Modern Dashboard Styles */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2rem;
    color: #667eea;
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-left: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: blink 2s infinite;
}

.status-dot.active {
    background: #4CAF50;
    box-shadow: 0 0 10px #4CAF50;
}

.status-dot.inactive {
    background: #F44336;
}

/* Main Content */
.main {
    padding: 40px 0;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(45, 45, 77, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-content h3 {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: #a0a0a0;
}

/* Charts */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.chart-container {
    background: rgba(45, 45, 77, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    height: 400px; /* Fixed container height */
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1.2rem;
    color: #ffffff;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.btn-chart {
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #a0a0a0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-chart.active,
.btn-chart:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    color: #ffffff;
}

/* Chart Canvas - Height Control to 350px max */
#performance-chart,
#activity-chart {
    max-height: 350px !important;
    width: 100% !important;
    height: 350px !important;
}

.chart-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 350px;
    overflow: hidden;
    position: relative;
}

/* Recent Activity */
.recent-activity {
    background: rgba(45, 45, 77, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.activity-header h3 {
    font-size: 1.2rem;
    color: #ffffff;
}

.btn-refresh {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity-icon.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.activity-icon.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.activity-icon.info {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.activity-content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.activity-content p {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.activity-time {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-left: auto;
}

/* System Health */
.system-health {
    background: rgba(45, 45, 77, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
}

.system-health h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.health-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.health-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.health-status {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.health-status.active {
    color: #4CAF50;
}

.health-status.pending {
    color: #FFC107;
}

.health-status.inactive {
    color: #F44336;
}

.health-detail {
    font-size: 0.8rem;
    color: #a0a0a0;
}

/* Reports Section */
.reports-section {
    margin-bottom: 40px;
}

.reports-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.report-card {
    background: rgba(45, 45, 77, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.report-card:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.5);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.report-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.report-type {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.report-meta {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 12px;
}

.report-summary {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Actions */
.actions-section {
    margin-bottom: 40px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.secondary {
    background: rgba(45, 45, 77, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

/* Footer */
.footer {
    background: rgba(26, 26, 46, 0.9);
    border-top: 1px solid rgba(102, 126, 234, 0.3);
    padding: 30px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info p {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 16px;
}

.loading-spinner p {
    font-size: 1.2rem;
    color: #a0a0a0;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .health-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(45, 45, 77, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}