/* Analytics Styles */
.analytics-section {
    margin-bottom: 2rem;
}

.analytics-section:last-child {
    margin-bottom: 0;
}

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.analytics-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.analytics-card-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.analytics-card-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.analytics-card-subtext {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.section-header-with-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn-reset-analytics {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-analytics:hover {
    background: #f9fafb;
    border-color: #ef4444;
    color: #ef4444;
}

.btn-reset-analytics svg {
    flex-shrink: 0;
}

.btn-refresh-analytics {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh-analytics:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #3c82f6;
    color: #3c82f6;
}

.btn-refresh-analytics:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-refresh-analytics svg {
    flex-shrink: 0;
}

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

.chart-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chart-date-range-select,
.chart-group-by-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.chart-date-range-select:hover,
.chart-group-by-select:hover {
    border-color: #3c82f6;
}

.chart-date-range-select:focus,
.chart-group-by-select:focus {
    outline: none;
    border-color: #3c82f6;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.analytics-chart-container {
    margin-top: 1rem;
    height: 350px;
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.analytics-chart-container canvas {
    max-height: 100%;
}

.scroll-depth-heatmap {
    margin-top: 1rem;
}

.scroll-depth-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

.scroll-depth-label {
    min-width: 80px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.scroll-depth-visual {
    flex: 1;
    height: 24px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.scroll-depth-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.scroll-depth-stats {
    min-width: 120px;
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
}

.link-url {
    color: #3c82f6;
    text-decoration: none;
}

.link-url:hover {
    text-decoration: underline;
}

.analytics-list {
    margin-top: 1rem;
}

.analytics-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.analytics-list-label {
    color: #374151;
    font-size: 0.875rem;
}

.analytics-list-value {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.analytics-table {
    margin-top: 1rem;
    overflow-x: auto;
}

.analytics-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.analytics-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.analytics-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
}

.analytics-table tbody tr:hover {
    background: #f9fafb;
}

.analytics-table tbody tr:last-child td {
    border-bottom: none;
}

