/* DmApp Creator Analytics Dashboard Styles */

/* ===== ANALYTICS DASHBOARD ===== */

.analytics-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== OVERVIEW CARDS ===== */

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

.metric-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.metric-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
    color: #00FF00;
    margin: 10px 0;
}

.metric-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* ===== INSIGHTS SECTION ===== */

.insights-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.insights-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

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

.insight-card {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid;
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.insight-card.success {
    background: linear-gradient(135deg, #E6FFE6, #CCFFCC);
    border-color: #00FF00;
}

.insight-card.warning {
    background: linear-gradient(135deg, #FFF3E6, #FFE6CC);
    border-color: #FFA500;
}

.insight-card.info {
    background: linear-gradient(135deg, #E6F3FF, #CCE6FF);
    border-color: #0088FF;
}

.insight-card.tip {
    background: linear-gradient(135deg, #F3E6FF, #E6CCFF);
    border-color: #9966FF;
}

.insight-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-content strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.insight-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ===== OPTIMAL TIMES SECTION ===== */

.times-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.times-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.time-card {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1), rgba(0, 204, 0, 0.05));
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.time-card:hover {
    transform: scale(1.05);
    border-color: #00FF00;
}

.time-value {
    font-size: 24px;
    font-weight: bold;
    color: #00AA00;
    margin-bottom: 8px;
}

.time-engagement {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.time-posts {
    font-size: 12px;
    color: #999;
}

/* ===== AUDIENCE SECTION ===== */

.audience-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.audience-section h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

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

.audience-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
}

.audience-card h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span {
    color: #666;
    font-size: 14px;
}

.stat-row strong {
    color: #00FF00;
    font-size: 16px;
}

/* ===== DEMOGRAPHIC CHARTS ===== */

.demo-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.demo-label {
    min-width: 60px;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.demo-progress {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.demo-fill {
    height: 100%;
    background: linear-gradient(90deg, #00FF00, #00CC00);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.demo-value {
    min-width: 50px;
    text-align: right;
    font-size: 13px;
    color: #00AA00;
    font-weight: bold;
}

/* ===== LOCATION ITEMS ===== */

.location-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background: white;
    margin-bottom: 8px;
    transition: background 0.2s ease;
}

.location-item:hover {
    background: #f5f5f5;
}

.location-item span {
    font-size: 14px;
    color: #666;
}

.location-item strong {
    font-size: 16px;
    color: #00FF00;
}

/* ===== NO DATA STATE ===== */

.no-data {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px;
    font-style: italic;
}

/* ===== POST INSIGHTS TABLE ===== */

.post-insights-table {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.post-insights-table table {
    width: 100%;
    border-collapse: collapse;
}

.post-insights-table th {
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.post-insights-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #333;
}

.post-insights-table tr:last-child td {
    border-bottom: none;
}

.post-insights-table tr:hover {
    background: #f9f9f9;
}

/* ===== PERFORMANCE BADGE ===== */

.performance-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.performance-badge.excellent {
    background: #E6FFE6;
    color: #00AA00;
}

.performance-badge.good {
    background: #E6F3FF;
    color: #0088FF;
}

.performance-badge.average {
    background: #FFF3E6;
    color: #FF8800;
}

.performance-badge.poor {
    background: #FFE6E6;
    color: #FF0000;
}

/* ===== EXPORT BUTTON ===== */

.export-analytics-btn {
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
    margin-top: 20px;
}

.export-analytics-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 255, 0, 0.4);
}

.export-analytics-btn:active {
    transform: translateY(0);
}

/* ===== TREND INDICATORS ===== */

.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.trend-indicator.up {
    color: #00AA00;
    background: rgba(0, 255, 0, 0.1);
}

.trend-indicator.down {
    color: #FF0000;
    background: rgba(255, 0, 0, 0.1);
}

.trend-indicator.neutral {
    color: #999;
    background: rgba(0, 0, 0, 0.05);
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1200px) {
    .analytics-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .analytics-dashboard {
        padding: 15px;
    }
    
    .analytics-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .metric-icon {
        font-size: 28px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .times-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .audience-stats {
        grid-template-columns: 1fr;
    }
    
    .insights-section,
    .times-section,
    .audience-section {
        padding: 20px;
    }
    
    .post-insights-table {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .analytics-overview {
        grid-template-columns: 1fr;
    }
    
    .times-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== DARK MODE ===== */

@media (prefers-color-scheme: dark) {
    .analytics-dashboard {
        background: #1a1a1a;
    }
    
    .metric-card,
    .insights-section,
    .times-section,
    .audience-section,
    .post-insights-table {
        background: #2a2a2a;
    }
    
    .insights-section h3,
    .times-section h3,
    .audience-section h3 {
        color: white;
    }
    
    .metric-label {
        color: #ccc;
    }
    
    .insight-content strong {
        color: white;
    }
    
    .insight-content p {
        color: #ccc;
    }
    
    .audience-card {
        background: #333;
    }
    
    .audience-card h4 {
        color: white;
    }
    
    .stat-row span {
        color: #ccc;
    }
    
    .post-insights-table td {
        color: #ccc;
        border-bottom-color: #444;
    }
    
    .post-insights-table tr:hover {
        background: #333;
    }
    
    .location-item {
        background: #333;
    }
    
    .location-item:hover {
        background: #3a3a3a;
    }
    
    .location-item span {
        color: #ccc;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .analytics-dashboard {
        max-width: 100%;
    }
    
    .metric-card,
    .insights-section,
    .times-section,
    .audience-section {
        box-shadow: none;
        border: 1px solid #e0e0e0;
        page-break-inside: avoid;
    }
    
    .export-analytics-btn {
        display: none;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .metric-card,
    .time-card,
    .insight-card {
        animation: none !important;
        transition: none !important;
    }
    
    .demo-fill {
        transition: none !important;
    }
}

/* ===== HIGH CONTRAST ===== */

@media (prefers-contrast: high) {
    .metric-card,
    .insights-section,
    .times-section,
    .audience-section {
        border: 2px solid #00FF00;
    }
    
    .time-card {
        border-width: 3px;
    }
}

/* ===== LOADING STATE ===== */

.analytics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.analytics-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #00FF00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.analytics-loading p {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
}
