/**
 * Reports View Styles
 * ProductiveApp v4.0
 */

/* Period Selector */
.reports-period-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: 12px;
    width: fit-content;
}

.period-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.period-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--accent);
    color: white;
}

/* Reports Content */
.reports-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.reports-loading,
.reports-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
}

.reports-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Summary Cards */
.reports-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.report-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.report-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-card-icon svg {
    width: 24px;
    height: 24px;
}

.report-card-content {
    flex: 1;
}

.report-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.report-card-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Charts Section */
.reports-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Report Section */
.report-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
}

.report-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.report-section h3 svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

/* Activity Chart */
.activity-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 150px;
    padding-top: 20px;
}

.activity-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.activity-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--accent), var(--accent-light));
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    position: relative;
    transition: height 0.3s ease;
}

.activity-bar:hover {
    opacity: 0.8;
}

.activity-count {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.activity-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
}

/* Status Distribution */
.status-distribution {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-bar {
    display: flex;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.status-segment {
    transition: width 0.3s ease;
}

.status-segment.todo {
    background: var(--text-muted);
}

.status-segment.in-progress {
    background: var(--warning);
}

.status-segment.done {
    background: var(--success);
}

.status-segment.empty {
    background: var(--bg-tertiary);
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

/* Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.projects-list .no-data {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
}

.project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    gap: 16px;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.project-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-count {
    font-size: 12px;
    color: var(--text-muted);
}

.project-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .reports-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .reports-charts {
        grid-template-columns: 1fr;
    }

    .project-progress {
        min-width: 100px;
    }

    .activity-label {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .reports-summary {
        grid-template-columns: 1fr;
    }

    .report-card {
        padding: 16px;
    }

    .report-card-value {
        font-size: 24px;
    }
}
